summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in18
-rw-r--r--test/README534
-rw-r--r--test/aclocal.m41898
-rw-r--r--test/background.c44
-rw-r--r--test/blue.c192
-rw-r--r--test/bs.65
-rw-r--r--test/bs.c143
-rw-r--r--test/bulgarian-utf8-tabs.txt6
-rw-r--r--test/cardfile.c39
-rw-r--r--test/chgat.c52
-rw-r--r--test/clip_printw.c45
-rw-r--r--test/color_content.c331
-rw-r--r--test/color_name.h9
-rw-r--r--test/color_set.c8
-rwxr-xr-xtest/configure11252
-rw-r--r--test/configure.in232
-rw-r--r--test/demo_altkeys.c41
-rw-r--r--test/demo_defkey.c50
-rw-r--r--test/demo_forms.c73
-rw-r--r--test/demo_keyok.c9
-rw-r--r--test/demo_menus.c125
-rw-r--r--test/demo_new_pair.c356
-rw-r--r--test/demo_panels.c70
-rw-r--r--test/demo_tabs.c119
-rw-r--r--test/demo_termcap.c198
-rw-r--r--test/demo_terminfo.c120
-rw-r--r--test/ditto.c29
-rw-r--r--test/dots.c120
-rw-r--r--test/dots_curses.c112
-rw-r--r--test/dots_mvcur.c122
-rw-r--r--test/dots_termcap.c137
-rw-r--r--test/dots_xcurses.c268
-rw-r--r--test/dump_window.c179
-rw-r--r--test/dump_window.h40
-rw-r--r--test/echochar.c41
-rw-r--r--test/edit_field.c152
-rw-r--r--test/edit_field.h12
-rw-r--r--test/escherknot.xbm473
-rw-r--r--test/extended_color.c252
-rw-r--r--test/filter.c326
-rw-r--r--test/firework.c61
-rw-r--r--test/firstlast.c20
-rw-r--r--test/foldkeys.c39
-rw-r--r--test/form_driver_w.c66
-rw-r--r--test/gdc.622
-rw-r--r--test/gdc.c67
-rw-r--r--test/hanoi.c231
-rw-r--r--test/hashtest.c17
-rw-r--r--test/inch_wide.c26
-rw-r--r--test/inchs.c25
-rw-r--r--test/ins_wide.c12
-rw-r--r--test/insdelln.c37
-rw-r--r--test/inserts.c10
-rw-r--r--test/key_names.c8
-rw-r--r--test/keynames.c5
-rw-r--r--test/knight.c485
-rw-r--r--test/linedata.h15
-rw-r--r--test/linux-color.dat5
-rw-r--r--test/list_keys.c512
-rwxr-xr-xtest/listused.sh5
-rw-r--r--test/lrtest.c12
-rwxr-xr-xtest/make-tar.sh9
-rw-r--r--test/mensetmanus.xbm258
-rw-r--r--test/mini.xterm_48x48.xpm264
-rw-r--r--test/mk-test.awk50
-rw-r--r--test/modules44
-rw-r--r--test/movewindow.c66
-rw-r--r--test/ncurses.c2170
-rw-r--r--test/ncurses_tst.hin5
-rw-r--r--test/newdemo.c30
-rw-r--r--test/package/debian-mingw/compat1
-rw-r--r--test/package/debian-mingw/control18
-rw-r--r--test/package/debian-mingw/copyright78
-rw-r--r--test/package/debian-mingw/docs1
-rwxr-xr-xtest/package/debian-mingw/rules101
-rw-r--r--test/package/debian-mingw/source/format1
-rw-r--r--test/package/debian-mingw/watch4
-rw-r--r--test/package/debian-mingw64/compat1
-rw-r--r--test/package/debian-mingw64/control18
-rw-r--r--test/package/debian-mingw64/copyright78
-rw-r--r--test/package/debian-mingw64/docs1
-rwxr-xr-xtest/package/debian-mingw64/rules101
-rw-r--r--test/package/debian-mingw64/source/format1
-rw-r--r--test/package/debian-mingw64/watch4
-rw-r--r--test/package/debian/compat2
-rw-r--r--test/package/debian/control14
-rw-r--r--test/package/debian/copyright17
-rwxr-xr-xtest/package/debian/rules158
-rw-r--r--test/package/debian/source/format2
-rw-r--r--test/package/debian/watch2
-rw-r--r--test/package/mingw-ncurses-examples.spec42
-rw-r--r--test/package/ncurses-examples.spec97
-rw-r--r--test/padview.c529
-rw-r--r--test/pair_content.c317
-rw-r--r--test/parse_rgb.h98
-rw-r--r--test/picsmap.c1763
-rw-r--r--test/picsmap.h75
-rw-r--r--test/popup_msg.c184
-rw-r--r--test/popup_msg.h43
-rw-r--r--test/programs48
-rw-r--r--test/railroad.c16
-rw-r--r--test/rain.c89
-rw-r--r--test/redraw.c75
-rw-r--r--test/savescreen.c440
-rwxr-xr-xtest/savescreen.sh20
-rw-r--r--test/sp_tinfo.c352
-rw-r--r--test/tclock.c63
-rw-r--r--test/terminal.xbm52
-rw-r--r--test/test.priv.h438
-rw-r--r--test/test_add_wchstr.c37
-rw-r--r--test/test_addchstr.c28
-rw-r--r--test/test_addstr.c21
-rw-r--r--test/test_addwstr.c44
-rw-r--r--test/test_arrays.c153
-rw-r--r--test/test_get_wstr.c43
-rw-r--r--test/test_getstr.c41
-rw-r--r--test/test_instr.c12
-rw-r--r--test/test_inwstr.c11
-rw-r--r--test/test_opaque.c5
-rw-r--r--test/test_setupterm.c216
-rw-r--r--test/test_sgr.c384
-rw-r--r--test/test_termattrs.c200
-rw-r--r--test/test_vid_puts.c32
-rw-r--r--test/test_vidputs.c33
-rw-r--r--test/testaddch.c5
-rw-r--r--test/testcurs.c247
-rw-r--r--test/testscanw.c7
-rwxr-xr-xtest/tput-colorcube131
-rwxr-xr-xtest/tput-initc156
-rwxr-xr-xtest/tracemunch660
-rw-r--r--test/view.c672
-rw-r--r--test/widechars-utf8-tabs.txt15
-rw-r--r--test/widechars.h7
-rw-r--r--test/worm.c139
-rw-r--r--test/xmas.c1048
-rw-r--r--test/xterm-16color.dat11
-rw-r--r--test/xterm-256color.dat11
-rw-r--r--test/xterm-88color.dat11
-rw-r--r--test/xterm-color_48x48.xpm61
139 files changed, 24694 insertions, 7899 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 15928eb..16bfc45 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,6 +1,7 @@
-# $Id: Makefile.in,v 1.114 2014/11/15 00:46:05 tom Exp $
+# $Id: Makefile.in,v 1.121 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 1998-2017,2018 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"), #
@@ -34,7 +35,7 @@
# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:
-SHELL = /bin/sh
+SHELL = @SHELL@
VPATH = @srcdir@
@SET_MAKE@
@@ -54,10 +55,13 @@ bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
includesubdir = @includesubdir@
+datarootdir = @datarootdir@
+datadir = @datadir@
BINDIR = $(DESTDIR)$(bindir)
LIBDIR = $(DESTDIR)$(libdir)
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
+DATADIR = $(DESTDIR)$(datadir)
PACKAGE = @PACKAGE@
@@ -67,8 +71,10 @@ LIBTOOL_CLEAN = @LIB_CLEAN@
LIBTOOL_COMPILE = @LIB_COMPILE@
LIBTOOL_LINK = @LIB_LINK@
-INSTALL = @INSTALL@
-INSTALL_PROG = @INSTALL_PROGRAM@
+INSTALL = @INSTALL@ @INSTALL_OPT_O@
+INSTALL_PROG = @INSTALL_PROGRAM@ @INSTALL_OPT_S@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
transform = @program_transform_name@
TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
@@ -79,7 +85,7 @@ CC = @CC@
CPP = @CPP@
CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H -DDATA_DIR=\"$(datadir)\" @CPPFLAGS@
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
diff --git a/test/README b/test/README
index 62b6dff..310b7b3 100644
--- a/test/README
+++ b/test/README
@@ -1,5 +1,6 @@
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. --
+-- Copyright 2018-2019,2020 Thomas E. Dickey --
+-- Copyright 1998-2017,2018 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,31 +26,47 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: README,v 1.48 2013/01/19 21:30:38 tom Exp $
+-- $Id: README,v 1.69 2020/02/02 23:34:34 tom Exp $
-------------------------------------------------------------------------------
-The programs in this directory are designed to test your newest toy :-)
-Check the sources for any further details.
+The programs in this directory are used to test and demonstrate ncurses.
+Some are interesting in themselves, while others merely show how some of
+the library calls are used. Some date back to the initial releases of
+ncurses during the mid-1990s, such as:
-blue - Blue Moon, a nifty solitaire (uses color)
-bs.c - the game of Battleships (uses color)
-firework.c - multi-colored fireworks (uses color)
-gdc.c - Great Digital Clock (uses color)
-hanoi.c - the game of hanoi (uses color essentially)
-knight.c - the game of Knight's Tour (uses color)
-lrtest.c - test of access to the lower-right corner
-ncurses.c - multi-test program (uses color)
-newdemo.c - another test from PDCurses (uses color)
-rain.c - rain drops keep falling on my head...
-tclock.c - analog/digital clock
-testcurs.c - a test from the PDCurses people (uses color)
-worm.c - worms run all over your screen (uses color)
-xmas.c - Xmas greeting card
+ blue - Blue Moon, a nifty solitaire (uses color)
+ bs.c - the game of Battleships (uses color)
+ firework.c - multi-colored fireworks (uses color)
+ gdc.c - Great Digital Clock (uses color)
+ hanoi.c - the game of hanoi (uses color essentially)
+ knight.c - the game of Knight's Tour (uses color)
+ lrtest.c - test of access to the lower-right corner
+ ncurses.c - multi-test program (uses color)
+ newdemo.c - another test from PDCurses (uses color)
+ rain.c - rain drops keep falling on my head...
+ tclock.c - analog/digital clock
+ testcurs.c - a test from the PDCurses people (uses color)
+ tracemunch - Perl script to make trace scripts easier to read
+ worm.c - worms run all over your screen (uses color)
+ xmas.c - Xmas greeting card
-The bs and knight games demonstrate processing of mouse events under xterm.
-This directory also contains:
+Besides being built as part of ncurses, the programs are also packaged as
+"ncurses-examples". Despite the name, the programs have been adjusted to
+allow them to build with other curses implementations, to provide a way to
+compare those with ncurses.
-tracemunch - Perl script to crunch trace scripts to make them easier to read
+You can build the programs by
+
+ ./configure
+ make
+
+The configure script has several options which allow you to tell it more
+about the curses implementation for which you are building the examples.
+Use
+
+ ./configure --help
+
+to list the options.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
@@ -57,6 +74,7 @@ tracemunch - Perl script to crunch trace scripts to make them easier to read
These programs provide examples of use, but do not comprise a complete set of
tests. Here is a list of library externals, noting those that are used:
+
libform:
-------
TYPE_ALNUM test: demo_forms
@@ -72,23 +90,24 @@ data_behind test: demo_forms
dup_field -
dynamic_field_info test: demo_forms
field_arg test: demo_forms
-field_back test: demo_forms
-field_buffer test: cardfile demo_forms edit_field ncurses
+field_back test: demo_forms edit_field
+field_buffer test: cardfile demo_forms ncurses
field_count test: demo_forms
field_fore test: demo_forms
field_index test: demo_forms
-field_info test: ncurses
+field_info test: edit_field ncurses
field_init -
field_just -
field_opts test: demo_forms ncurses
-field_opts_off test: cardfile demo_forms
+field_opts_off test: cardfile demo_forms form_driver_w
field_opts_on test: demo_forms
field_pad test: demo_forms
field_status test: demo_forms
field_term -
field_type test: demo_forms
-field_userptr test: demo_forms edit_field ncurses
+field_userptr test: edit_field ncurses
form_driver test: cardfile demo_forms edit_field ncurses
+form_driver_w test: form_driver_w
form_fields test: cardfile demo_forms
form_init -
form_opts -
@@ -100,23 +119,23 @@ form_request_name test: edit_field
form_sub test: cardfile demo_forms ncurses
form_term -
form_userptr -
-form_win test: cardfile demo_forms edit_field ncurses
-free_field test: cardfile demo_forms ncurses
+form_win test: cardfile demo_forms edit_field form_driver_w ncurses
+free_field test: cardfile demo_forms form_driver_w ncurses
free_fieldtype test: ncurses
-free_form test: cardfile demo_forms ncurses
+free_form test: cardfile demo_forms form_driver_w ncurses
link_field -
link_fieldtype -
move_field -
-new_field test: cardfile demo_forms ncurses
+new_field test: cardfile demo_forms form_driver_w ncurses
new_fieldtype test: ncurses
-new_form test: cardfile demo_forms ncurses
+new_form test: cardfile demo_forms form_driver_w ncurses
new_form_sp -
new_page test: demo_forms
pos_form_cursor -
-post_form test: cardfile demo_forms ncurses
+post_form test: cardfile demo_forms form_driver_w ncurses
scale_form test: demo_forms ncurses
set_current_field test: demo_forms
-set_field_back test: cardfile demo_forms edit_field ncurses
+set_field_back test: cardfile demo_forms edit_field form_driver_w ncurses
set_field_buffer test: cardfile demo_forms edit_field ncurses
set_field_fore test: demo_forms
set_field_init -
@@ -126,7 +145,7 @@ set_field_pad test: demo_forms
set_field_status test: demo_forms
set_field_term -
set_field_type test: demo_forms ncurses
-set_field_userptr test: demo_forms ncurses
+set_field_userptr test: edit_field ncurses
set_fieldtype_arg -
set_fieldtype_choice -
set_form_fields -
@@ -139,7 +158,8 @@ set_form_userptr -
set_form_win test: cardfile demo_forms ncurses
set_max_field test: demo_forms
set_new_page test: demo_forms
-unpost_form test: cardfile demo_forms ncurses
+unfocus_current_field -
+unpost_form test: cardfile demo_forms form_driver_w ncurses
libmenu:
-------
@@ -155,7 +175,7 @@ item_opts -
item_opts_off -
item_opts_on -
item_term -
-item_userptr -
+item_userptr test: demo_menus
item_value test: demo_menus ncurses
item_visible -
menu_back -
@@ -185,16 +205,16 @@ pos_menu_cursor lib: menu
post_menu test: demo_menus ncurses
scale_menu test: demo_menus ncurses
set_current_item -
-set_item_init -
+set_item_init test: demo_menus
set_item_opts -
-set_item_term -
-set_item_userptr -
+set_item_term test: demo_menus
+set_item_userptr test: demo_menus
set_item_value test: demo_menus ncurses
set_menu_back test: demo_menus
set_menu_fore test: demo_menus
set_menu_format test: demo_menus ncurses
set_menu_grey -
-set_menu_init -
+set_menu_init test: demo_menus
set_menu_items -
set_menu_mark test: demo_menus
set_menu_opts -
@@ -202,7 +222,7 @@ set_menu_pad -
set_menu_pattern -
set_menu_spacing -
set_menu_sub test: demo_menus ncurses
-set_menu_term -
+set_menu_term test: demo_menus
set_menu_userptr -
set_menu_win test: demo_menus ncurses
set_top_row -
@@ -211,43 +231,45 @@ unpost_menu test: demo_menus ncurses
libncurses:
----------
-BC -
-COLORS test: echochar ncurses savescreen xmas
-COLOR_PAIR test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
-COLOR_PAIRS test: echochar ncurses newdemo savescreen
-COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+BC test: demo_termcap
+COLORS test: color_content demo_new_pair dots_curses dots_xcurses echochar ncurses pair_content picsmap savescreen xmas
+COLOR_PAIR test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels dots_curses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+COLOR_PAIRS test: demo_new_pair dots_curses dots_xcurses echochar ncurses newdemo pair_content
+COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
ESCDELAY test: test_opaque
-LINES test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
-PAIR_NUMBER test: ncurses
-PC lib: ncurses
+LINES test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+PAIR_NUMBER test: dump_window ncurses
+PC test: demo_termcap
SP lib: form
TABSIZE test: test_opaque
-UP -
-acs_map test: background gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
-add_wch test: demo_panels ncurses test_add_wchstr test_addwstr
+UP test: demo_termcap
+acs_map test: background gdc ins_wide inserts knight movewindow ncurses newdemo savescreen test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
+add_wch test: demo_new_pair demo_panels ncurses picsmap savescreen test_add_wchstr test_addwstr
add_wchnstr test: test_add_wchstr
add_wchstr test: test_add_wchstr view
-addch test: background blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
+addch test: background blue bs color_content dots_curses echochar hashtest ncurses padview pair_content picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
addchnstr test: test_addchstr
addchstr test: test_addchstr
addnstr test: test_addstr
-addnwstr test: ncurses test_addwstr
-addstr test: blue bs cardfile gdc hanoi lrtest ncurses savescreen test_addstr
-addwstr test: ncurses test_addwstr
+addnwstr test: dots_xcurses ncurses test_addwstr
+addstr test: blue bs cardfile filter gdc hanoi lrtest ncurses test_addstr
+addwstr test: blue test_addwstr
+alloc_pair test: demo_new_pair dots_xcurses
+alloc_pair_sp -
assume_default_colors test: background ncurses
assume_default_colors_sp -
-attr_get test: ncurses
-attr_off test: ncurses
-attr_on test: ncurses
+attr_get -
+attr_off test: dots_xcurses ncurses
+attr_on test: dots_xcurses ncurses
attr_set test: ncurses
-attroff test: echochar filter gdc ncurses tclock
-attron test: bs echochar filter gdc ncurses
-attrset test: bs firework gdc hanoi insdelln ncurses rain tclock testaddch testcurs
-baudrate lib: ncurses
-baudrate_sp lib: ncurses
-beep test: blue bs cardfile chgat clip_printw demo_forms demo_menus demo_panels edit_field hanoi inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
+attroff test: blue dots_curses echochar filter gdc ncurses tclock
+attron test: blue bs dots_curses echochar filter gdc ncurses
+attrset test: bs filter firework gdc hanoi insdelln ncurses picsmap rain tclock testaddch testcurs
+baudrate test: ncurses
+baudrate_sp test: sp_tinfo
+beep test: blue bs cardfile chgat clip_printw demo_forms demo_menus demo_new_pair demo_panels edit_field firstlast hanoi inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses padview popup_msg rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
beep_sp lib: ncurses
-bkgd test: background cardfile demo_forms ncurses savescreen tclock view
+bkgd test: background cardfile demo_forms ncurses padview savescreen tclock view
bkgdset test: background ncurses testaddch
bkgrnd test: ncurses
bkgrndset test: ncurses
@@ -256,76 +278,86 @@ boolfnames test: demo_terminfo test_arrays progs: dump_entry
boolnames test: demo_terminfo test_arrays progs: dump_entry infocmp
border -
border_set -
-box test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto edit_field inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+box test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
box_set test: ncurses
-can_change_color test: ncurses
-can_change_color_sp -
-cbreak test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
-cbreak_sp lib: ncurses
+can_change_color test: color_content extended_color ncurses
+can_change_color_sp test: extended_color
+cbreak test: background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+cbreak_sp test: sp_tinfo
chgat test: chgat
-clear test: blue bs gdc ncurses testcurs xmas
+clear test: blue bs filter gdc ncurses padview testcurs xmas
clearok test: bs knight
-clrtobot test: demo_menus ncurses
-clrtoeol test: blue bs demo_altkeys demo_menus foldkeys hanoi hashtest movewindow ncurses view
-color_content test: ncurses
+clrtobot test: demo_menus ncurses view
+clrtoeol test: blue bs demo_altkeys filter foldkeys form_driver_w hanoi hashtest movewindow ncurses padview view
+color_content test: color_content ncurses picsmap
color_content_sp -
-color_set test: color_set ncurses
+color_set test: color_set dots_xcurses extended_color ncurses
copywin test: ncurses testcurs
-cur_term test: demo_terminfo dots dots_mvcur lrtest test_vid_puts test_vidputs progs: clear tabs tput tset
-curs_set test: echochar firework gdc hanoi lrtest ncurses newdemo rain savescreen tclock testcurs worm xmas
-curs_set_sp lib: ncurses
-curscr test: demo_panels edit_field knight lrtest ncurses savescreen tclock view
-curses_version test: ncurses progs: infocmp tic toe tput tset
+cur_term test: demo_termcap demo_terminfo dots dots_mvcur filter list_keys lrtest sp_tinfo test_sgr test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs tput tset
+curs_set test: demo_new_pair echochar firework gdc hanoi lrtest ncurses newdemo picsmap rain savescreen tclock testcurs worm xmas
+curs_set_sp test: sp_tinfo
+curscr test: demo_panels knight lrtest ncurses popup_msg savescreen tclock
+curses_version test: ncurses progs: clear infocmp tabs tic toe tput tset
def_prog_mode test: bs ncurses
-def_prog_mode_sp lib: ncurses
+def_prog_mode_sp test: sp_tinfo
def_shell_mode -
-def_shell_mode_sp lib: ncurses
+def_shell_mode_sp test: sp_tinfo
define_key test: demo_altkeys demo_defkey foldkeys
-define_key_sp -
-del_curterm lib: ncurses
+define_key_sp test: sp_tinfo
+del_curterm test: demo_terminfo sp_tinfo test_sgr
del_curterm_sp lib: ncurses
delay_output test: newdemo
-delay_output_sp -
+delay_output_sp test: sp_tinfo
delch -
deleteln test: insdelln
delscreen test: ditto dots_mvcur
-delwin test: cardfile chgat clip_printw demo_forms demo_panels edit_field inch_wide inchs ins_wide insdelln inserts movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+delwin test: cardfile chgat clip_printw demo_forms demo_panels inch_wide inchs ins_wide insdelln inserts ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
derwin test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
-doupdate test: cardfile demo_menus demo_panels ditto edit_field ins_wide inserts knight movewindow ncurses redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
+doupdate test: cardfile demo_menus demo_panels ditto ins_wide inserts knight movewindow ncurses padview popup_msg redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
doupdate_sp lib: ncurses
-dupwin test: edit_field
+dupwin test: popup_msg
echo test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
echo_sp lib: ncurses
echo_wchar test: ncurses
echochar test: echochar ncurses
-endwin test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_mvcur echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+endwin test: background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto dots_curses dots_mvcur dots_xcurses echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
endwin_sp lib: ncurses
-erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses tclock test_opaque testcurs
-erasechar lib: ncurses
-erasechar_sp lib: ncurses
-erasewchar -
+erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses picsmap tclock test_opaque testcurs
+erasechar test: ncurses
+erasechar_sp test: sp_tinfo
+erasewchar test: ncurses
+extended_color_content test: color_content extended_color
+extended_color_content_sp test: extended_color
+extended_pair_content test: extended_color pair_content
+extended_pair_content_sp test: extended_color
+extended_slk_color test: extended_color
+extended_slk_color_sp test: extended_color
filter test: filter
filter_sp -
-flash test: cardfile lrtest movewindow ncurses tclock testcurs
+find_pair test: demo_new_pair
+find_pair_sp -
+flash test: cardfile filter lrtest movewindow ncurses tclock testcurs
flash_sp -
flushinp test: ncurses newdemo testcurs
-flushinp_sp lib: ncurses
+flushinp_sp test: sp_tinfo
+free_pair test: demo_new_pair
+free_pair_sp -
get_escdelay -
get_escdelay_sp -
-get_wch -
+get_wch test: form_driver_w
get_wstr test: test_get_wstr
getattrs -
-getbegx test: chgat clip_printw demo_menus demo_panels insdelln movewindow ncurses newdemo redraw testcurs
-getbegy test: chgat clip_printw demo_menus demo_panels insdelln movewindow ncurses newdemo redraw testcurs
+getbegx test: chgat clip_printw demo_menus demo_panels dump_window insdelln movewindow ncurses newdemo redraw testcurs
+getbegy test: chgat clip_printw demo_menus demo_panels dump_window insdelln movewindow ncurses newdemo redraw testcurs
getbkgd test: ncurses
getbkgrnd test: ncurses
-getcchar test: ncurses view
-getch test: background blue bs chgat color_set demo_altkeys filter firework firstlast foldkeys hanoi hashtest insdelln lrtest savescreen tclock test_opaque testaddch testcurs view xmas
-getcurx test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs
-getcury test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels edit_field firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_opaque testcurs
-getmaxx test: chgat clip_printw demo_panels inch_wide inchs insdelln movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
-getmaxy test: chgat clip_printw demo_forms demo_panels inch_wide inchs insdelln movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
-getmouse test: bs knight movewindow ncurses
+getcchar test: ncurses savescreen view
+getch test: background blue bs chgat color_content color_set demo_altkeys demo_new_pair extended_color filter firework firstlast foldkeys hanoi hashtest insdelln lrtest padview pair_content picsmap savescreen tclock test_opaque testaddch testcurs view xmas
+getcurx test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels dump_window extended_color filter firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs view
+getcury test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels dump_window extended_color filter firstlast foldkeys insdelln movewindow ncurses popup_msg redraw savescreen test_opaque testcurs view
+getmaxx test: chgat clip_printw demo_panels dump_window firstlast inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getmaxy test: chgat clip_printw demo_forms demo_panels dump_window firstlast inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getmouse test: bs demo_menus knight movewindow ncurses testcurs
getmouse_sp -
getn_wstr test: test_get_wstr
getnstr test: filter ncurses test_getstr
@@ -334,22 +366,22 @@ getpary test: movewindow
getstr test: test_getstr
getwin test: ncurses
getwin_sp -
-halfdelay test: view
-halfdelay_sp -
-has_colors test: background bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
+halfdelay test: padview view
+halfdelay_sp test: sp_tinfo
+has_colors test: background bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
has_colors_sp lib: ncurses
-has_ic test: lrtest
-has_ic_sp lib: ncurses
-has_il -
-has_il_sp lib: ncurses
+has_ic test: lrtest ncurses
+has_ic_sp test: sp_tinfo
+has_il test: ncurses
+has_il_sp test: sp_tinfo
has_key -
-has_key_sp lib: ncurses
+has_key_sp test: sp_tinfo
has_mouse -
has_mouse_sp -
hline test: gdc ncurses
hline_set -
idcok test: test_opaque
-idlok test: ncurses test_opaque testscanw view
+idlok test: ncurses padview test_opaque testscanw view
immedok test: test_opaque
in_wch test: inch_wide
in_wchnstr test: inch_wide
@@ -357,11 +389,15 @@ in_wchstr test: inch_wide
inch test: inchs
inchnstr test: inchs
inchstr test: inchs
-init_color test: ncurses
-init_color_sp lib: ncurses
-init_pair test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+init_color test: color_content ncurses
+init_color_sp -
+init_extended_color test: color_content extended_color
+init_extended_color_sp test: extended_color
+init_extended_pair test: extended_color ncurses pair_content picsmap
+init_extended_pair_sp test: extended_color
+init_pair test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
init_pair_sp -
-initscr test: background blue bs cardfile chgat clip_printw color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firework firstlast gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+initscr test: background blue bs cardfile chgat clip_printw color_content color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses dots_xcurses echochar filter firework firstlast form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
innstr test: test_instr
innwstr test: test_inwstr
ins_nwstr test: ins_wide
@@ -374,19 +410,19 @@ insnstr test: inserts
insstr test: inserts
instr test: test_instr
intrflush test: demo_forms movewindow
-intrflush_sp -
+intrflush_sp test: sp_tinfo
inwstr test: test_inwstr
is_cleared test: test_opaque
is_idcok test: test_opaque
is_idlok test: test_opaque
is_immedok test: test_opaque
-is_keypad test: test_opaque
+is_keypad test: ncurses test_opaque
is_leaveok test: test_opaque
is_linetouched lib: form
is_nodelay test: test_opaque
is_notimeout test: test_opaque
is_pad -
-is_scrollok test: test_opaque
+is_scrollok test: ncurses test_opaque
is_subwin -
is_syncok test: test_opaque
is_term_resized -
@@ -395,29 +431,30 @@ is_wintouched lib: ncurses
isendwin -
isendwin_sp -
key_defined test: demo_defkey foldkeys
-key_defined_sp lib: ncurses
+key_defined_sp test: sp_tinfo
key_name test: key_names ncurses
keybound test: demo_altkeys demo_defkey
-keybound_sp lib: ncurses
-keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw test_getstr testcurs view progs: tic
-keyname_sp lib: ncurses
+keybound_sp test: sp_tinfo
+keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses padview redraw test_getstr testcurs view progs: tic
+keyname_sp test: sp_tinfo
keyok test: demo_keyok foldkeys
-keyok_sp lib: ncurses
-keypad test: bs cardfile chgat clip_printw demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
-killchar lib: ncurses
-killchar_sp lib: ncurses
-killwchar -
+keyok_sp test: sp_tinfo
+keypad test: bs cardfile chgat clip_printw demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto filter firework foldkeys form_driver_w hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses padview popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
+killchar test: ncurses
+killchar_sp test: sp_tinfo
+killwchar test: ncurses
leaveok test: hanoi test_opaque
-longname test: testcurs progs: tput
+longname test: ncurses testcurs progs: tput
+longname_sp test: sp_tinfo
mcprint -
mcprint_sp -
meta test: key_names keynames ncurses
-mouse_trafo -
+mouse_trafo lib: form
mouseinterval -
mouseinterval_sp -
-mousemask test: bs demo_forms demo_menus knight movewindow ncurses
+mousemask test: bs demo_forms demo_menus knight movewindow ncurses testcurs
mousemask_sp -
-move test: blue bs cardfile chgat demo_altkeys demo_menus echochar foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
+move test: blue bs cardfile chgat demo_altkeys demo_menus demo_new_pair dots_curses dots_xcurses echochar filter foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
mvadd_wch test: ncurses test_add_wchstr test_addwstr
mvadd_wchnstr test: test_add_wchstr
mvadd_wchstr test: test_add_wchstr
@@ -457,14 +494,14 @@ mvinsnstr test: inserts
mvinsstr test: inserts
mvinstr test: test_instr
mvinwstr test: test_inwstr
-mvprintw test: background bs demo_menus firework hanoi ncurses tclock view
+mvprintw test: background bs firework form_driver_w hanoi ncurses padview savescreen tclock view
mvscanw -
mvvline test: ncurses
mvvline_set test: ncurses
mvwadd_wch test: test_add_wchstr test_addwstr
mvwadd_wchnstr test: test_add_wchstr
mvwadd_wchstr test: inch_wide test_add_wchstr
-mvwaddch test: movewindow newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs xmas
+mvwaddch test: movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs xmas
mvwaddchnstr test: test_addchstr
mvwaddchstr test: inchs test_addchstr
mvwaddnstr test: newdemo test_addstr testcurs
@@ -479,13 +516,13 @@ mvwgetch test: inch_wide inchs test_get_wstr test_getstr test_instr test_inwst
mvwgetn_wstr test: test_get_wstr
mvwgetnstr test: test_getstr
mvwgetstr test: test_getstr
-mvwhline test: movewindow
+mvwhline test: movewindow ncurses
mvwhline_set -
-mvwin test: cardfile demo_menus movewindow testcurs xmas
+mvwin test: cardfile demo_menus movewindow ncurses testcurs xmas
mvwin_wch test: inch_wide
mvwin_wchnstr test: inch_wide
mvwin_wchstr test: inch_wide
-mvwinch test: inchs newdemo testcurs
+mvwinch test: dump_window inchs newdemo testcurs
mvwinchnstr test: inchs
mvwinchstr test: inchs
mvwinnstr test: test_instr testcurs
@@ -498,74 +535,76 @@ mvwinsnstr test: inserts
mvwinsstr test: inserts testcurs
mvwinstr test: test_instr
mvwinwstr test: test_inwstr
-mvwprintw test: chgat clip_printw demo_panels inch_wide inchs insdelln ncurses test_instr test_inwstr testcurs
+mvwprintw test: demo_menus demo_panels inch_wide inchs ncurses test_instr test_inwstr testcurs
mvwscanw test: testcurs
-mvwvline test: ins_wide inserts movewindow test_add_wchstr test_addchstr test_addstr test_addwstr
+mvwvline test: ins_wide inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
mvwvline_set -
-napms test: demo_panels ditto dots dots_mvcur echochar firework gdc hanoi lrtest ncurses railroad rain tclock test_opaque testcurs view worm xmas progs: tset
-napms_sp -
-new_prescr lib: ncurses
-newpad test: edit_field ncurses testcurs
+napms test: demo_panels ditto dots dots_curses dots_mvcur dots_xcurses echochar extended_color firework firstlast gdc hanoi lrtest ncurses padview picsmap railroad rain tclock test_opaque testcurs view worm xmas progs: tset
+napms_sp test: sp_tinfo
+new_prescr test: sp_tinfo
+newpad test: ncurses padview popup_msg testcurs
newpad_sp lib: ncurses
newscr lib: ncurses
-newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames
+newterm test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_setupterm test_termattrs
newterm_sp -
-newwin test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
+newwin test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
newwin_sp lib: ncurses
nl test: demo_forms ncurses rain testcurs
nl_sp lib: ncurses
nocbreak test: testcurs
-nocbreak_sp lib: ncurses
-nodelay test: ditto firework gdc lrtest ncurses newdemo rain tclock test_opaque view worm xmas
-noecho test: background bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+nocbreak_sp test: sp_tinfo
+nodelay test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo padview rain tclock test_opaque view worm xmas
+noecho test: background bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
noecho_sp lib: ncurses
nofilter -
nofilter_sp -
-nonl test: bs demo_forms hashtest movewindow ncurses view worm xmas
+nonl test: bs demo_forms hashtest movewindow ncurses padview view worm xmas
nonl_sp lib: ncurses
noqiflush -
-noqiflush_sp -
+noqiflush_sp test: sp_tinfo
noraw test: demo_forms demo_menus ncurses testcurs
-noraw_sp lib: ncurses
-notimeout test: test_opaque
+noraw_sp test: sp_tinfo
+notimeout test: ncurses test_opaque
numcodes test: demo_termcap test_arrays progs: dump_entry
numfnames test: demo_terminfo test_arrays progs: dump_entry
numnames test: demo_terminfo test_arrays progs: dump_entry infocmp
-ospeed progs: tset
+ospeed test: demo_termcap progs: tset
overlay test: ncurses testcurs xmas
overwrite test: ncurses savescreen
-pair_content test: background color_set
+pair_content test: background color_set pair_content
pair_content_sp lib: ncurses
pecho_wchar -
pechochar -
-pnoutrefresh test: edit_field ncurses
+pnoutrefresh test: ncurses padview popup_msg
prefresh test: testcurs
-printw test: background blue bs color_set demo_altkeys demo_defkey demo_keyok demo_menus filter foldkeys ncurses savescreen testcurs testscanw view
-putp progs: tput
-putp_sp -
+printw test: background blue bs color_content color_set demo_altkeys demo_defkey demo_keyok extended_color filter foldkeys ncurses pair_content savescreen testcurs testscanw view
+putp test: filter test_sgr progs: tput
+putp_sp test: sp_tinfo
putwin test: ncurses
qiflush -
-qiflush_sp -
+qiflush_sp test: sp_tinfo
raw test: demo_forms ncurses redraw testcurs
-raw_sp lib: ncurses
-redrawwin test: redraw view
-refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
+raw_sp test: sp_tinfo
+redrawwin test: padview redraw view
+refresh test: blue bs color_content demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses dots_mvcur dots_xcurses echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest movewindow ncurses pair_content picsmap savescreen tclock testcurs view xmas
+reset_color_pairs test: picsmap
+reset_color_pairs_sp -
reset_prog_mode test: filter ncurses
-reset_prog_mode_sp lib: ncurses
-reset_shell_mode test: bs filter savescreen
-reset_shell_mode_sp lib: ncurses
+reset_prog_mode_sp test: sp_tinfo
+reset_shell_mode test: bs filter savescreen test_setupterm
+reset_shell_mode_sp test: sp_tinfo
resetty -
-resetty_sp -
-resize_term test: view
+resetty_sp test: sp_tinfo
+resize_term -
resize_term_sp -
resizeterm -
resizeterm_sp lib: ncurses
-restartterm -
+restartterm test: test_setupterm
restartterm_sp -
ripoffline test: demo_menus ncurses
ripoffline_sp -
savetty -
-savetty_sp -
+savetty_sp test: sp_tinfo
scanw test: testcurs testscanw
scr_dump test: savescreen
scr_init test: savescreen
@@ -576,17 +615,17 @@ scr_set test: savescreen
scr_set_sp -
scrl test: view
scroll test: testcurs
-scrollok test: clip_printw demo_altkeys demo_defkey demo_keyok demo_panels ditto foldkeys hashtest knight ncurses redraw test_opaque testcurs testscanw view
-set_curterm lib: ncurses
-set_curterm_sp -
+scrollok test: clip_printw color_content demo_altkeys demo_defkey demo_keyok demo_new_pair demo_panels ditto foldkeys hashtest knight ncurses pair_content picsmap redraw test_opaque testcurs testscanw view
+set_curterm test: list_keys sp_tinfo
+set_curterm_sp test: sp_tinfo
set_escdelay test: test_opaque
set_escdelay_sp lib: ncurses
set_tabsize test: test_opaque
-set_tabsize_sp -
+set_tabsize_sp test: sp_tinfo
set_term lib: ncurses
-setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view
+setcchar test: demo_new_pair demo_panels ins_wide ncurses picsmap savescreen test_add_wchstr test_addwstr
setscrreg test: view
-setupterm test: demo_termcap demo_terminfo dots test_vid_puts test_vidputs progs: clear tabs tput tset
+setupterm test: demo_terminfo dots list_keys sp_tinfo test_setupterm test_sgr test_termattrs test_vid_puts test_vidputs progs: clear tabs tput tset
slk_attr -
slk_attr_off -
slk_attr_on -
@@ -597,122 +636,122 @@ slk_attroff lib: ncurses
slk_attroff_sp -
slk_attron lib: ncurses
slk_attron_sp -
-slk_attrset test: ncurses
+slk_attrset test: extended_color ncurses
slk_attrset_sp -
slk_clear test: ncurses
slk_clear_sp -
slk_color test: ncurses
slk_color_sp -
-slk_init test: ncurses
+slk_init test: extended_color ncurses
slk_init_sp -
slk_label test: ncurses
slk_label_sp -
-slk_noutrefresh test: ncurses
+slk_noutrefresh test: extended_color ncurses
slk_noutrefresh_sp -
slk_refresh test: ncurses
slk_refresh_sp lib: ncurses
slk_restore test: ncurses
slk_restore_sp lib: ncurses
-slk_set test: ncurses
+slk_set test: extended_color ncurses
slk_set_sp -
-slk_touch test: ncurses
+slk_touch test: extended_color ncurses
slk_touch_sp lib: ncurses
slk_wset test: ncurses
standend test: blue gdc ncurses
standout test: blue ncurses
-start_color test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+start_color test: background blue bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
start_color_sp -
-stdscr test: bs chgat clip_printw demo_altkeys demo_forms demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
+stdscr test: background bs chgat clip_printw color_content demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
strcodes test: demo_termcap test_arrays progs: dump_entry
-strfnames test: demo_terminfo test_arrays progs: dump_entry
-strnames test: demo_terminfo foldkeys test_arrays progs: dump_entry infocmp tic
+strfnames test: demo_terminfo list_keys test_arrays progs: dump_entry
+strnames test: demo_terminfo foldkeys list_keys test_arrays progs: dump_entry infocmp tic
subpad test: testcurs
subwin test: movewindow ncurses newdemo testcurs
syncok test: test_opaque
-term_attrs test: ncurses
+term_attrs test: ncurses test_termattrs
term_attrs_sp -
-termattrs test: ncurses testcurs
+termattrs test: ncurses test_termattrs testcurs
termattrs_sp lib: ncurses
-termname test: testcurs
-termname_sp lib: ncurses
-tgetent test: demo_termcap railroad
-tgetent_sp -
+termname test: list_keys ncurses testcurs
+termname_sp test: sp_tinfo
+tgetent test: demo_termcap dots_termcap railroad
+tgetent_sp test: sp_tinfo
tgetflag test: demo_termcap
-tgetflag_sp -
-tgetnum test: demo_termcap railroad
-tgetnum_sp -
-tgetstr test: demo_termcap railroad
-tgetstr_sp -
-tgoto test: railroad
-tigetflag test: demo_terminfo progs: tic tput
-tigetflag_sp -
-tigetnum test: demo_terminfo ncurses progs: tput
-tigetnum_sp -
-tigetstr test: demo_defkey demo_terminfo foldkeys testcurs progs: tput
-tigetstr_sp -
-timeout test: rain savescreen
+tgetflag_sp test: sp_tinfo
+tgetnum test: demo_termcap dots_termcap railroad
+tgetnum_sp test: sp_tinfo
+tgetstr test: demo_termcap dots_termcap railroad
+tgetstr_sp test: sp_tinfo
+tgoto test: dots_termcap railroad progs: tic
+tigetflag test: demo_terminfo savescreen progs: tic tput
+tigetflag_sp test: sp_tinfo
+tigetnum test: demo_terminfo dots dots_mvcur ncurses savescreen progs: tput
+tigetnum_sp test: sp_tinfo
+tigetstr test: blue demo_defkey demo_new_pair demo_terminfo foldkeys list_keys savescreen test_sgr testcurs progs: clear_cmd tput
+tigetstr_sp test: sp_tinfo
+timeout test: filter rain savescreen
tiparm -
touchline test: chgat clip_printw insdelln
-touchwin test: chgat clip_printw demo_menus edit_field filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
-tparm test: dots dots_mvcur progs: tabs tic tput
-tputs test: dots dots_mvcur railroad test_vid_puts test_vidputs progs: clear tabs tset
-tputs_sp lib: ncurses
-trace test: demo_menus hashtest lrtest ncurses testcurs view worm
-ttytype lib: ncurses
+touchwin test: chgat clip_printw demo_menus filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
+tparm test: dots dots_mvcur test_sgr progs: reset_cmd tabs tic tput
+tputs test: dots dots_mvcur dots_termcap railroad test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs
+tputs_sp test: sp_tinfo
+trace test: demo_menus hashtest lrtest ncurses padview redraw test_sgr test_termattrs test_vid_puts test_vidputs testcurs view worm
+ttytype test: demo_terminfo test_sgr
typeahead test: testcurs
-typeahead_sp lib: ncurses
+typeahead_sp test: sp_tinfo
unctrl test: ncurses redraw test_add_wchstr test_addchstr testcurs
-unctrl_sp lib: ncurses
+unctrl_sp test: sp_tinfo
unget_wch -
unget_wch_sp -
ungetch test: bs knight
ungetch_sp lib: ncurses
-ungetmouse -
+ungetmouse lib: menu
ungetmouse_sp -
untouchwin lib: form
-use_default_colors test: background filter firework gdc hanoi knight ncurses rain tclock worm xmas
+use_default_colors test: background dots_curses dots_xcurses filter firework gdc hanoi knight ncurses picsmap rain tclock worm xmas
use_default_colors_sp -
-use_env test: ncurses progs: tput
-use_env_sp -
-use_extended_names test: demo_termcap demo_terminfo progs: infocmp tic
+use_env test: dots dots_curses dots_mvcur dots_xcurses ncurses progs: clear tput
+use_env_sp test: sp_tinfo
+use_extended_names test: demo_termcap demo_terminfo list_keys progs: infocmp tic
use_legacy_coding -
use_legacy_coding_sp -
use_screen test: ditto
-use_tioctl test: ncurses
-use_tioctl_sp -
+use_tioctl test: ncurses progs: clear tput
+use_tioctl_sp test: sp_tinfo
use_window test: rain worm
vid_attr test: test_vid_puts
vid_attr_sp -
vid_puts test: test_vid_puts
-vid_puts_sp -
+vid_puts_sp lib: ncurses
vidattr test: test_vidputs
vidattr_sp -
vidputs test: test_vidputs
-vidputs_sp lib: ncurses
+vidputs_sp -
vline test: gdc ncurses
vline_set -
-vw_printw test: clip_printw
+vw_printw test: clip_printw movewindow
vw_scanw -
-vwprintw test: movewindow
-vwscanw lib: ncurses
-wadd_wch test: inch_wide test_add_wchstr test_addwstr
-wadd_wchnstr test: test_add_wchstr
+vwprintw -
+vwscanw -
+wadd_wch test: inch_wide ncurses test_add_wchstr test_addwstr
+wadd_wchnstr test: savescreen test_add_wchstr
wadd_wchstr test: test_add_wchstr
-waddch test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
+waddch test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque view worm
waddchnstr test: test_addchstr
waddchstr test: test_addchstr
-waddnstr test: test_addstr
+waddnstr test: demo_forms test_addstr
waddnwstr test: ncurses test_addwstr
-waddstr test: chgat clip_printw demo_forms demo_panels edit_field firstlast ins_wide insdelln knight ncurses redraw test_add_wchstr test_addstr test_addwstr testcurs
-waddwstr test: ins_wide test_add_wchstr test_addwstr test_get_wstr
-wattr_get -
+waddstr test: chgat clip_printw demo_forms demo_panels firstlast ins_wide insdelln knight ncurses popup_msg redraw test_add_wchstr test_addstr test_addwstr testcurs
+waddwstr test: ins_wide ncurses padview test_add_wchstr test_addwstr test_get_wstr view
+wattr_get test: ncurses
wattr_off lib: ncurses
wattr_on lib: ncurses
-wattr_set -
+wattr_set test: ncurses
wattroff test: demo_forms ncurses testcurs xmas
wattron test: testcurs xmas
-wattrset test: clip_printw demo_forms insdelln ncurses newdemo test_get_wstr test_getstr testcurs xmas
-wbkgd test: cardfile demo_forms demo_menus ncurses newdemo testcurs
+wattrset test: clip_printw demo_forms insdelln ncurses newdemo padview test_get_wstr test_getstr testcurs xmas
+wbkgd test: cardfile demo_forms demo_menus ncurses newdemo padview testcurs
wbkgdset test: demo_panels ins_wide inserts ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
wbkgrnd lib: ncurses
wbkgrndset lib: ncurses
@@ -721,7 +760,7 @@ wborder_set test: ncurses
wchgat test: chgat test_get_wstr test_getstr view
wclear test: ncurses test_opaque testcurs
wclrtobot test: firstlast inch_wide inchs ncurses test_instr test_inwstr testcurs
-wclrtoeol test: chgat clip_printw demo_defkey demo_keyok demo_panels firstlast inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_instr test_inwstr testcurs
+wclrtoeol test: chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels firstlast inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_instr test_inwstr testcurs
wcolor_set lib: ncurses
wcursyncup lib: form
wdelch test: ncurses testcurs
@@ -729,11 +768,12 @@ wdeleteln test: insdelln testcurs
wecho_wchar lib: ncurses
wechochar lib: ncurses
wenclose test: ncurses
-werase test: cardfile demo_forms demo_menus demo_panels edit_field firstlast knight ncurses newdemo test_get_wstr test_getstr test_opaque testcurs xmas
+werase test: cardfile demo_forms demo_menus demo_panels firstlast knight ncurses newdemo popup_msg test_get_wstr test_getstr test_opaque testcurs view xmas
wget_wch test: ins_wide ncurses test_add_wchstr test_addwstr
wget_wstr test: test_get_wstr
wgetbkgrnd lib: ncurses
-wgetch test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto edit_field gdc insdelln inserts knight movewindow ncurses newdemo rain redraw test_addchstr test_addstr test_opaque testcurs worm
+wgetch test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto dump_window edit_field gdc insdelln inserts knight movewindow ncurses newdemo popup_msg rain redraw test_addchstr test_addstr test_opaque testcurs worm
+wgetdelay -
wgetn_wstr test: ncurses test_get_wstr
wgetnstr test: ncurses test_getstr
wgetparent test: test_opaque
@@ -741,8 +781,8 @@ wgetscrreg test: test_opaque
wgetstr test: test_getstr
whline test: testcurs
whline_set lib: ncurses
-win_wch test: inch_wide
-win_wchnstr test: inch_wide
+win_wch test: inch_wide savescreen
+win_wchnstr test: inch_wide view
win_wchstr test: inch_wide
winch test: inchs knight testcurs
winchnstr test: inchs
@@ -760,12 +800,12 @@ winsstr test: inserts
winstr test: test_instr
winwstr test: test_inwstr
wmouse_trafo test: ncurses
-wmove test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus demo_panels firstlast foldkeys inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs worm
-wnoutrefresh test: demo_menus ditto edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
-wprintw test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+wmove test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus demo_panels dump_window extended_color firstlast foldkeys inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo padview picsmap redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+wnoutrefresh test: demo_menus ditto inch_wide inchs ins_wide inserts knight movewindow ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
+wprintw test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
wredrawln test: redraw
-wrefresh test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels edit_field firstlast ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
-wresize test: cardfile ncurses
+wrefresh test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels firstlast ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs worm xmas
+wresize test: cardfile demo_menus ncurses
wscanw test: testcurs
wscrl test: ncurses testcurs
wsetscrreg test: ncurses testcurs
@@ -800,3 +840,5 @@ show_panel test: demo_panels ncurses
top_panel test: cardfile demo_panels ncurses
update_panels test: cardfile demo_panels ncurses
update_panels_sp -
+
+-- vile:txtmode
diff --git a/test/aclocal.m4 b/test/aclocal.m4
index a9a5045..788c1bb 100644
--- a/test/aclocal.m4
+++ b/test/aclocal.m4
@@ -1,5 +1,6 @@
dnl***************************************************************************
-dnl Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
+dnl Copyright 2018-2019,2020 Thomas E. Dickey *
+dnl Copyright 2003-2017,2018 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@@ -26,7 +27,7 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
-dnl $Id: aclocal.m4,v 1.102 2014/12/06 13:39:47 tom Exp $
+dnl $Id: aclocal.m4,v 1.176 2020/02/09 02:02:53 tom Exp $
dnl
dnl Author: Thomas E. Dickey
dnl
@@ -36,10 +37,35 @@ dnl These macros are maintained separately from NCURSES. The copyright on
dnl this file applies to the aggregation of macros and does not affect use of
dnl these macros in other applications.
dnl
-dnl See http://invisible-island.net/autoconf/ for additional information.
+dnl See these pages for additional information:
+dnl https://invisible-island.net/autoconf/
+dnl https://invisible-island.net/autoconf/my-autoconf.html
dnl
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
+dnl AM_LANGINFO_CODESET version: 4 updated: 2015/04/18 08:56:57
+dnl -------------------
+dnl Inserted as requested by gettext 0.10.40
+dnl File from /usr/share/aclocal
+dnl codeset.m4
+dnl ====================
+dnl serial AM1
+dnl
+dnl From Bruno Haible.
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(CODESET);],
+ am_cv_langinfo_codeset=yes,
+ am_cv_langinfo_codeset=no)
+ ])
+ if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
@@ -66,7 +92,7 @@ define([CF_ACVERSION_COMPARE],
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 11 updated: 2014/07/22 05:32:57
+dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
dnl The second parameter if given makes this macro verbose.
@@ -84,11 +110,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $1
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -96,35 +122,35 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags)
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+ CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags)
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+ CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
@@ -137,24 +163,24 @@ done
if test -n "$cf_new_cflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
- CFLAGS="$CFLAGS $cf_new_cflags"
+ CF_APPEND_TEXT(CFLAGS,$cf_new_cflags)
fi
if test -n "$cf_new_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags)
fi
if test -n "$cf_new_extra_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags)
fi
AC_SUBST(EXTRA_CPPFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
+dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13
dnl -------------
dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's
dnl redundant. We don't normally need to add -I/usr/local/include for gcc,
@@ -185,7 +211,7 @@ if test -n "$1" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir)
AC_TRY_COMPILE([#include <stdio.h>],
[printf("Hello")],
[],
@@ -205,6 +231,8 @@ if test -n "$1" ; then
else
break
fi
+ else
+ break
fi
done
done
@@ -219,7 +247,7 @@ dnl $1 = library to add, without the "-l"
dnl $2 = variable to update (default $LIBS)
AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57
+dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57
dnl -------------
dnl Adds to the library-path
dnl
@@ -231,31 +259,31 @@ dnl
AC_DEFUN([CF_ADD_LIBDIR],
[
if test -n "$1" ; then
- for cf_add_libdir in $1
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- CF_VERBOSE(adding $cf_add_libdir to library-path)
- ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
- fi
- fi
- done
+ for cf_add_libdir in $1
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ CF_VERBOSE(adding $cf_add_libdir to library-path)
+ ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
+ fi
+ fi
+ done
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27
+dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33
dnl -----------
dnl Add one or more libraries, used to enforce consistency. Libraries are
dnl prepended to an existing list, since their dependencies are assumed to
@@ -264,19 +292,19 @@ dnl
dnl $1 = libraries to add, with the "-l", etc.
dnl $2 = variable to update (default $LIBS)
AC_DEFUN([CF_ADD_LIBS],[
-cf_add_libs="$1"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in [$]ifelse($2,,LIBS,[$2])
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="[$]ifelse($2,,LIBS,[$2])"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
ifelse($2,,LIBS,[$2])="$cf_add_libs"
])dnl
@@ -316,6 +344,16 @@ ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]
}
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
+dnl --------------
+dnl use this macro for appending text without introducing an extra blank at
+dnl the beginning
+define([CF_APPEND_TEXT],
+[
+ test -n "[$]$1" && $1="[$]$1 "
+ $1="[$]{$1}$2"
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
dnl --------------
dnl Allow user to disable a normally-on option.
@@ -328,7 +366,7 @@ dnl Allow user to enable a normally-off option.
AC_DEFUN([CF_ARG_ENABLE],
[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
+dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
dnl -------------
dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
dnl values.
@@ -341,37 +379,75 @@ dnl $4 = action if perform if option is default
dnl $5 = default option value (either 'yes' or 'no')
AC_DEFUN([CF_ARG_OPTION],
[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
- if test "$enableval" != "$5" ; then
+ if test "$enableval" != "$5" ; then
ifelse([$3],,[ :]dnl
,[ $3]) ifelse([$4],,,[
- else
- $4])
- fi],[enableval=$5 ifelse([$4],,,[
- $4
+ else
+ $4])
+ fi],[enableval=$5 ifelse([$4],,,[
+ $4
])dnl
- ])])dnl
+])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
+dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
-dnl into CC. This will not help with broken scripts that wrap the compiler with
-dnl options, but eliminates a more common category of user confusion.
+dnl into CC. This will not help with broken scripts that wrap the compiler
+dnl with options, but eliminates a more common category of user confusion.
+dnl
+dnl In particular, it addresses the problem of being able to run the C
+dnl preprocessor in a consistent manner.
+dnl
+dnl Caveat: this also disallows blanks in the pathname for the compiler, but
+dnl the nuisance of having inconsistent settings for compiler and preprocessor
+dnl outweighs that limitation.
AC_DEFUN([CF_CC_ENV_FLAGS],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
+AC_MSG_CHECKING(\$CFLAGS variable)
+case "x$CFLAGS" in
+(*-[[IUD]]*)
+ AC_MSG_RESULT(broken)
+ AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options)
+ cf_flags="$CFLAGS"
+ CFLAGS=
+ for cf_arg in $cf_flags
+ do
+ CF_ADD_CFLAGS($cf_arg)
+ done
+ ;;
+(*)
+ AC_MSG_RESULT(ok)
+ ;;
+esac
+
AC_MSG_CHECKING(\$CC variable)
-case "$CC" in #(vi
-*[[\ \ ]]-[[IUD]]*)
+case "$CC" in
+(*[[\ \ ]]-*)
AC_MSG_RESULT(broken)
- AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
+ AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
- cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
- CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
- CF_ADD_CFLAGS($cf_flags)
+ cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
+ cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
+ CC="$cf_prog"
+ for cf_arg in $cf_flags
+ do
+ case "x$cf_arg" in
+ (x-[[IUDfgOW]]*)
+ CF_ADD_CFLAGS($cf_arg)
+ ;;
+ (*)
+ CC="$CC $cf_arg"
+ ;;
+ esac
+ done
+ CF_VERBOSE(resulting CC: '$CC')
+ CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
+ CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
;;
-*)
+(*)
AC_MSG_RESULT(ok)
;;
esac
@@ -434,6 +510,63 @@ AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_CHECK_CURSES_LIB version: 2 updated: 2018/01/03 04:47:33
+dnl -------------------
+dnl $1 = nominal library name, used also for header lookup
+dnl $2 = suffix to append to library name
+dnl $3 = function to check for using AC_CHECK_LIB
+dnl $4 = optional parameter list for $3
+AC_DEFUN([CF_CHECK_CURSES_LIB],
+[
+AC_REQUIRE([CF_PKG_CONFIG])
+
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+ :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+ AC_MSG_CHECKING(pkg-config for $1$2)
+ if "$PKG_CONFIG" --exists $1$2 ; then
+ AC_MSG_RESULT(yes)
+
+ AC_MSG_CHECKING(if the $1$2 package files work)
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+ CF_ADD_CFLAGS(`$PKG_CONFIG --cflags $1$2`)
+ CF_ADD_LIBS(`$PKG_CONFIG --libs $1$2`)
+
+ AC_TRY_LINK([#include <$1.h>],
+ [(void) $3 ( ]ifelse([$4],,,[[$4]])[ );],
+ [AC_TRY_RUN([#include <$1.h>
+ int main(void)
+ { (void) $3 ( ]ifelse([$4],,,[[$4]])[ ); return 0; }],
+ [cf_have_curses_lib=yes],
+ [cf_have_curses_lib=no],
+ [cf_have_curses_lib=maybe])],
+ [cf_have_curses_lib=no])
+ AC_MSG_RESULT($cf_have_curses_lib)
+ test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+ if test "$cf_have_curses_lib" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ else
+ CF_UPPER(cf_upper,have_lib$1)
+ AC_DEFINE_UNQUOTED($cf_upper,1)
+ fi
+ fi
+fi
+if test "$cf_have_curses_lib" = no; then
+ AC_CHECK_LIB($1$2,$3,[
+ CF_UPPER(cf_upper,have_lib$1)
+ CF_ADD_LIBS(-l$1$2)
+ AC_DEFINE_UNQUOTED($cf_upper,1)])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
@@ -467,6 +600,66 @@ cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
fi
])
dnl ---------------------------------------------------------------------------
+dnl CF_CONST_X_STRING version: 3 updated: 2020/01/11 18:39:22
+dnl -----------------
+dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
+dnl character-strings.
+dnl
+dnl It is ambiguous because the specification accommodated the pre-ANSI
+dnl compilers bundled by more than one vendor in lieu of providing a standard C
+dnl compiler other than by costly add-ons. Because of this, the specification
+dnl did not take into account the use of const for telling the compiler that
+dnl string literals would be in readonly memory.
+dnl
+dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to
+dnl let the compiler decide how to represent Xt's strings which were #define'd.
+dnl That does not solve the problem of using the block of Xt's strings which
+dnl are compiled into the library (and is less efficient than one might want).
+dnl
+dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both
+dnl when compiling the library and compiling using the library, to tell the
+dnl compiler that String is const.
+AC_DEFUN([CF_CONST_X_STRING],
+[
+AC_REQUIRE([AC_PATH_XTRA])
+
+CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING])
+
+AC_TRY_COMPILE(
+[
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+],
+[String foo = malloc(1)],[
+
+AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
+ AC_TRY_COMPILE(
+ [
+#define _CONST_X_STRING /* X11R7.8 (perhaps) */
+#undef XTSTRINGDEFINES /* X11R5 and later */
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+ ],[String foo = malloc(1); *foo = 0],[
+ cf_cv_const_x_string=no
+ ],[
+ cf_cv_const_x_string=yes
+ ])
+])
+
+CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING])
+
+case $cf_cv_const_x_string in
+(no)
+ CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
+ ;;
+(*)
+ CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING)
+ ;;
+esac
+
+])
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_CURSES_ACS_MAP version: 7 updated: 2012/10/06 16:39:58
dnl -----------------
dnl Check for likely values of acs_map[]:
@@ -488,50 +681,58 @@ done
test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map,[Define as needed to override ncurses prefix _nc_])
])
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_DATA version: 5 updated: 2014/07/19 18:41:17
+dnl CF_CURSES_CHECK_DATA version: 9 updated: 2020/02/08 21:00:26
dnl --------------------
dnl Check if curses.h defines the given data/variable.
dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
+dnl
+dnl $1 = data item(s) to check for
+dnl $2 = action on success, e.g., "break" to quit checking a series of choices
AC_DEFUN([CF_CURSES_CHECK_DATA],
[
-AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h})
+for cf_data in $1
+do
+AC_MSG_CHECKING(for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h})
-AC_TRY_COMPILE(CF__CURSES_HEAD,[
-void *foo = &($1)
-],cf_result=yes,cf_result=no)
+AC_TRY_COMPILE(CF__CURSES_HEAD,
+CF__CURSES_DATA(foo,$cf_data)
+,[cf_result=yes
+],[cf_result=no])
AC_MSG_RESULT($cf_result)
if test $cf_result = yes ; then
- CF_UPPER(cf_result,have_curses_data_$1)
+ CF_UPPER(cf_result,have_curses_data_$cf_data)
AC_DEFINE_UNQUOTED($cf_result)
+ ifelse($2,,,[$2])
else
- AC_MSG_CHECKING(for data $1 in library)
+ AC_MSG_CHECKING(for data $cf_data in library)
# BSD linkers insist on making weak linkage, but resolve at runtime.
AC_TRY_RUN(CF__CURSES_HEAD
[
-extern char $1;
+extern char $cf_data;
int main(void)
{
- void *foo = &($1);
- fprintf(stderr, "testing linkage of $1:%p\n", foo);
+ ]CF__CURSES_DATA(foo,$cf_data)[
${cf_cv_main_return:-return}(foo == 0);
-}],[cf_result=yes],[cf_result=no],[
+}],[cf_result=yes
+],[cf_result=no],[
# cross-compiling
AC_TRY_LINK(CF__CURSES_HEAD
-[extern char $1;],[
+[extern char $cf_data;],[
do {
- void *foo = &($1);
- fprintf(stderr, "testing linkage of $1:%p\n", foo);
+ ]CF__CURSES_DATA(foo,$cf_data)[
${cf_cv_main_return:-return}(foo == 0);
} while (0)
],[cf_result=yes],[cf_result=no])
])
AC_MSG_RESULT($cf_result)
if test $cf_result = yes ; then
- CF_UPPER(cf_result,decl_curses_data_$1)
+ CF_UPPER(cf_result,decl_curses_data_$cf_data)
AC_DEFINE_UNQUOTED($cf_result)
+ # do not exit loop here, since we prefer system's declarations
fi
fi
+done
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CURSES_CHECK_TYPE version: 4 updated: 2012/10/06 16:39:58
@@ -568,22 +769,22 @@ CF_NCURSES_VERSION
CF_CURSES_LIBS
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CPPFLAGS version: 11 updated: 2011/04/09 14:51:08
+dnl CF_CURSES_CPPFLAGS version: 13 updated: 2018/06/20 20:23:13
dnl ------------------
dnl Look for the curses headers.
AC_DEFUN([CF_CURSES_CPPFLAGS],[
AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
cf_cv_curses_incdir=no
-case $host_os in #(vi
-hpux10.*) #(vi
+case $host_os in
+(hpux10.*)
if test "x$cf_cv_screen" = "xcurses_colr"
then
test -d /usr/include/curses_colr && \
cf_cv_curses_incdir="-I/usr/include/curses_colr"
fi
;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
if test "x$cf_cv_screen" = "xcurses_5lib"
then
test -d /usr/5lib && \
@@ -593,13 +794,16 @@ sunos3*|sunos4*)
;;
esac
])
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+if test "$cf_cv_curses_incdir" != no
+then
+ CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir)
+fi
CF_CURSES_HEADER
CF_TERM_HEADER
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_FUNCS version: 18 updated: 2014/07/19 18:44:41
+dnl CF_CURSES_FUNCS version: 19 updated: 2018/01/03 04:47:33
dnl ---------------
dnl Curses-functions are a little complicated, since a lot of them are macros.
AC_DEFUN([CF_CURSES_FUNCS],
@@ -620,9 +824,9 @@ do
[
#ifndef ${cf_func}
long foo = (long)(&${cf_func});
-fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
-if (foo + 1234 > 5678)
- ${cf_cv_main_return:-return}(foo);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
+if (foo + 1234L > 5678L)
+ ${cf_cv_main_return:-return}(foo != 0);
#endif
],
[cf_result=yes],
@@ -639,7 +843,7 @@ if (foo + 1234 > 5678)
done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_HEADER version: 3 updated: 2011/05/01 19:47:45
+dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30
dnl ----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs.
@@ -648,11 +852,9 @@ dnl $1 = ncurses when looking for ncurses, or is empty
AC_DEFUN([CF_CURSES_HEADER],[
AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
cf_cv_ncurses_header=none
-for cf_header in ifelse($1,,,[ \
- $1/ncurses.h \
- $1/curses.h]) \
- ncurses.h \
- curses.h ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
+for cf_header in \
+ ncurses.h ifelse($1,,,[$1/ncurses.h]) \
+ curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
do
AC_TRY_COMPILE([#include <${cf_header}>],
[initscr(); tgoto("?", 0,0)],
@@ -668,7 +870,7 @@ fi
AC_CHECK_HEADERS($cf_cv_ncurses_header)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 37 updated: 2013/02/09 17:33:50
+dnl CF_CURSES_LIBS version: 42 updated: 2018/06/20 20:23:13
dnl --------------
dnl Look for the curses libraries. Older curses implementations may require
dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
@@ -677,17 +879,17 @@ AC_DEFUN([CF_CURSES_LIBS],[
AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
AC_MSG_CHECKING(if we have identified curses libraries)
AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr(); tgoto("?", 0,0)],
- cf_result=yes,
- cf_result=no)
+ [initscr(); tgoto("?", 0,0)],
+ cf_result=yes,
+ cf_result=no)
AC_MSG_RESULT($cf_result)
if test "$cf_result" = no ; then
-case $host_os in #(vi
-freebsd*) #(vi
- AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
- ;;
-hpux10.*) #(vi
+case $host_os in
+(freebsd*)
+ AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
+ ;;
+(hpux10.*)
# Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
# next (1998), and xcurses "newer" (2000). There is no header file for
# Hcurses; the subdirectory curses_colr has the headers (curses.h and
@@ -701,14 +903,14 @@ hpux10.*) #(vi
AC_CHECK_LIB(Hcurses,initscr,[
# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
CF_ADD_LIBS(-lHcurses)
- CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+ CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES)
ac_cv_func_initscr=yes
])])
fi
;;
-linux*)
+(linux*)
case `arch 2>/dev/null` in
- x86_64)
+ (x86_64)
if test -d /lib64
then
CF_ADD_LIBDIR(/lib64)
@@ -716,21 +918,21 @@ linux*)
CF_ADD_LIBDIR(/lib)
fi
;;
- *)
+ (*)
CF_ADD_LIBDIR(/lib)
;;
esac
;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
if test "x$cf_cv_screen" = "xcurses_5lib"
then
if test -d /usr/5lib ; then
CF_ADD_LIBDIR(/usr/5lib)
CF_ADD_LIBS(-lcurses -ltermcap)
fi
- fi
- ac_cv_func_initscr=yes
- ;;
+ fi
+ ac_cv_func_initscr=yes
+ ;;
esac
if test ".$ac_cv_func_initscr" != .yes ; then
@@ -750,7 +952,10 @@ if test ".$ac_cv_func_initscr" != .yes ; then
AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
do
- AC_CHECK_LIB($cf_term_lib,tgoto,[break])
+ AC_CHECK_LIB($cf_term_lib,tgoto,[
+ : ${cf_nculib_root:=$cf_term_lib}
+ break
+ ])
done
])
fi
@@ -761,42 +966,41 @@ if test ".$ac_cv_func_initscr" != .yes ; then
then
for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
do
- AC_CHECK_LIB($cf_curs_lib,initscr,[break])
+ LIBS="-l$cf_curs_lib $cf_save_LIBS"
+ if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
+ AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr()],
+ [cf_result=yes],
+ [cf_result=no])
+ AC_MSG_RESULT($cf_result)
+ test $cf_result = yes && break
+ elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+ cf_result=no
+ elif test "$cf_term_lib" != predefined ; then
+ AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr(); tgoto((char *)0, 0, 0);],
+ [cf_result=no],
+ [
+ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr()],
+ [cf_result=yes],
+ [cf_result=error])
+ ])
+ AC_MSG_RESULT($cf_result)
+ test $cf_result != error && break
+ fi
done
fi
test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
-
- LIBS="-l$cf_curs_lib $cf_save_LIBS"
- if test "$cf_term_lib" = unknown ; then
- AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=no])
- AC_MSG_RESULT($cf_result)
- test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
- elif test "$cf_curs_lib" = "$cf_term_lib" ; then
- :
- elif test "$cf_term_lib" != predefined ; then
- AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
- AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr(); tgoto((char *)0, 0, 0);],
- [cf_result=no],
- [
- LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
- AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
- [initscr()],
- [cf_result=yes],
- [cf_result=error])
- ])
- AC_MSG_RESULT($cf_result)
- fi
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_TERM_H version: 10 updated: 2012/10/06 08:57:51
+dnl CF_CURSES_TERM_H version: 11 updated: 2015/04/15 19:08:48
dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations,
@@ -813,8 +1017,8 @@ AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
cf_header_list="term.h ncurses/term.h ncursesw/term.h"
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
cf_header_list="$cf_header_item $cf_header_list"
;;
@@ -831,8 +1035,8 @@ do
[cf_cv_term_header=no])
done
-case $cf_cv_term_header in #(vi
-no)
+case $cf_cv_term_header in
+(no)
# If curses is ncurses, some packagers still mess it up by trying to make
# us use GNU termcap. This handles the most common case.
for cf_header in ncurses/term.h ncursesw/term.h
@@ -853,20 +1057,20 @@ make an error
esac
])
-case $cf_cv_term_header in #(vi
-term.h) #(vi
+case $cf_cv_term_header in
+(term.h)
AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
-ncurses/term.h) #(vi
+(ncurses/term.h)
AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
-ncursesw/term.h)
+(ncursesw/term.h)
AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_UNCTRL_H version: 3 updated: 2013/11/03 06:26:10
+dnl CF_CURSES_UNCTRL_H version: 4 updated: 2015/04/15 19:08:48
dnl ------------------
dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
dnl may put it in a subdirectory (along with ncurses' other headers, of
@@ -883,8 +1087,8 @@ AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
cf_header_list="$cf_header_item $cf_header_list"
;;
@@ -902,20 +1106,20 @@ do
done
])
-case $cf_cv_unctrl_header in #(vi
-no)
+case $cf_cv_unctrl_header in
+(no)
AC_MSG_WARN(unctrl.h header not found)
;;
esac
-case $cf_cv_unctrl_header in #(vi
-unctrl.h) #(vi
+case $cf_cv_unctrl_header in
+(unctrl.h)
AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
;;
-ncurses/unctrl.h) #(vi
+(ncurses/unctrl.h)
AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
;;
-ncursesw/unctrl.h)
+(ncursesw/unctrl.h)
AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
;;
esac
@@ -983,7 +1187,7 @@ dnl ----------
dnl "dirname" is not portable, so we fake it with a shell script.
AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
+dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
@@ -1000,17 +1204,17 @@ AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
[ --disable-echo do not display "compiling" commands],
[
- ECHO_LT='--silent'
- ECHO_LD='@echo linking [$]@;'
- RULE_CC='@echo compiling [$]<'
- SHOW_CC='@echo compiling [$]@'
- ECHO_CC='@'
+ ECHO_LT='--silent'
+ ECHO_LD='@echo linking [$]@;'
+ RULE_CC='@echo compiling [$]<'
+ SHOW_CC='@echo compiling [$]@'
+ ECHO_CC='@'
],[
- ECHO_LT=''
- ECHO_LD=''
- RULE_CC=''
- SHOW_CC=''
- ECHO_CC=''
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC=''
+ SHOW_CC=''
+ ECHO_CC=''
])
AC_MSG_RESULT($enableval)
AC_SUBST(ECHO_LT)
@@ -1062,7 +1266,47 @@ if test "$cf_disable_rpath_hack" = no ; then
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03
+dnl CF_ENABLE_STRING_HACKS version: 5 updated: 2016/10/08 17:34:11
+dnl ----------------------
+dnl On a few platforms, the compiler and/or loader nags with untruthful
+dnl comments stating that "most" uses of strcat/strcpy/sprintf are incorrect,
+dnl and implying that most uses of the recommended alternatives are correct.
+dnl
+dnl Factually speaking, no one has actually counted the number of uses of these
+dnl functions versus the total of incorrect uses. Samples of a few thousand
+dnl instances are meaningless compared to the hundreds of millions of lines of
+dnl existing C code.
+dnl
+dnl strlcat/strlcpy are (as of 2012) non-standard, and are available on some
+dnl platforms, in implementations of varying quality. Likewise, snprintf is
+dnl standard - but evolved through phases, and older implementations are likely
+dnl to yield surprising results, as documented in manpages on various systems.
+AC_DEFUN([CF_ENABLE_STRING_HACKS],
+[
+AC_MSG_CHECKING(if you want to work around bogus compiler/loader warnings)
+AC_ARG_ENABLE(string-hacks,
+ [ --enable-string-hacks work around bogus compiler/loader warnings],
+ [with_string_hacks=$enableval],
+ [with_string_hacks=no])
+AC_MSG_RESULT($with_string_hacks)
+
+if test "x$with_string_hacks" = "xyes"; then
+ AC_DEFINE(USE_STRING_HACKS,1,[Define to 1 to work around bogus compiler/loader warnings])
+ AC_MSG_WARN(enabling string-hacks to work around bogus compiler/loader warnings)
+ AC_CHECK_FUNC(strlcat,[
+ AC_DEFINE(HAVE_STRLCAT,1,[Define to 1 if we have strlcat function])
+ ],[
+ AC_CHECK_LIB(bsd,strlcat,[
+ CF_ADD_LIB(bsd)
+ AC_CHECK_HEADERS(bsd/string.h)
+ AC_DEFINE(HAVE_STRLCAT,1,[Define to 1 if we have strlcat function])
+ ])
+ ])
+ AC_CHECK_FUNCS( strlcpy snprintf )
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ENABLE_WARNINGS version: 5 updated: 2017/09/29 20:01:16
dnl ------------------
dnl Configure-option to enable gcc warnings
AC_DEFUN([CF_ENABLE_WARNINGS],[
@@ -1077,7 +1321,7 @@ AC_MSG_RESULT($with_warnings)
if test "$with_warnings" = "yes"
then
CF_GCC_ATTRIBUTES
- CF_GCC_WARNINGS
+ CF_GCC_WARNINGS($1)
fi
fi
])dnl
@@ -1132,7 +1376,7 @@ fi
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
+dnl CF_FIND_LINKAGE version: 21 updated: 2018/06/20 20:23:13
dnl ---------------
dnl Find a library (specifically the linkage used in the code fragment),
dnl searching for it if it is not already in the library path.
@@ -1180,73 +1424,74 @@ AC_TRY_LINK([$1],[$2],[
cf_cv_find_linkage_$3=no
LIBS="$cf_save_LIBS"
- CF_VERBOSE(find linkage for $3 library)
- CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
-
- cf_save_CPPFLAGS="$CPPFLAGS"
- cf_test_CPPFLAGS="$CPPFLAGS"
-
- CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
- for cf_cv_header_path_$3 in $cf_search
- do
- if test -d $cf_cv_header_path_$3 ; then
- CF_VERBOSE(... testing $cf_cv_header_path_$3)
- CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
- AC_TRY_COMPILE([$1],[$2],[
- CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
- cf_cv_find_linkage_$3=maybe
- cf_test_CPPFLAGS="$CPPFLAGS"
- break],[
- CPPFLAGS="$cf_save_CPPFLAGS"
- ])
- fi
- done
-
- if test "$cf_cv_find_linkage_$3" = maybe ; then
-
- CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
-
- cf_save_LIBS="$LIBS"
- cf_save_LDFLAGS="$LDFLAGS"
-
- ifelse([$6],,,[
- CPPFLAGS="$cf_test_CPPFLAGS"
- LIBS="-l$3 $7 $cf_save_LIBS"
- AC_TRY_LINK([$1],[$2],[
- CF_VERBOSE(... found $3 library in system)
- cf_cv_find_linkage_$3=yes])
- CPPFLAGS="$cf_save_CPPFLAGS"
- LIBS="$cf_save_LIBS"
- ])
-
- if test "$cf_cv_find_linkage_$3" != yes ; then
- CF_LIBRARY_PATH(cf_search,$3)
- for cf_cv_library_path_$3 in $cf_search
- do
- if test -d $cf_cv_library_path_$3 ; then
- CF_VERBOSE(... testing $cf_cv_library_path_$3)
- CPPFLAGS="$cf_test_CPPFLAGS"
- LIBS="-l$3 $7 $cf_save_LIBS"
- LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
- AC_TRY_LINK([$1],[$2],[
- CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
- cf_cv_find_linkage_$3=yes
- cf_cv_library_file_$3="-l$3"
- break],[
- CPPFLAGS="$cf_save_CPPFLAGS"
- LIBS="$cf_save_LIBS"
- LDFLAGS="$cf_save_LDFLAGS"
- ])
- fi
- done
- CPPFLAGS="$cf_save_CPPFLAGS"
- LDFLAGS="$cf_save_LDFLAGS"
- fi
-
- else
- cf_cv_find_linkage_$3=no
- fi
- ],$7)
+ CF_VERBOSE(find linkage for $3 library)
+ CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_test_CPPFLAGS="$CPPFLAGS"
+
+ CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
+ for cf_cv_header_path_$3 in $cf_search
+ do
+ if test -d $cf_cv_header_path_$3 ; then
+ CF_VERBOSE(... testing $cf_cv_header_path_$3)
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3)
+ AC_TRY_COMPILE([$1],[$2],[
+ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
+ cf_cv_find_linkage_$3=maybe
+ cf_test_CPPFLAGS="$CPPFLAGS"
+ break],[
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ ])
+ fi
+ done
+
+ if test "$cf_cv_find_linkage_$3" = maybe ; then
+
+ CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
+
+ cf_save_LIBS="$LIBS"
+ cf_save_LDFLAGS="$LDFLAGS"
+
+ ifelse([$6],,,[
+ CPPFLAGS="$cf_test_CPPFLAGS"
+ LIBS="-l$3 $7 $cf_save_LIBS"
+ AC_TRY_LINK([$1],[$2],[
+ CF_VERBOSE(... found $3 library in system)
+ cf_cv_find_linkage_$3=yes])
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ ])
+
+ if test "$cf_cv_find_linkage_$3" != yes ; then
+ CF_LIBRARY_PATH(cf_search,$3)
+ for cf_cv_library_path_$3 in $cf_search
+ do
+ if test -d $cf_cv_library_path_$3 ; then
+ CF_VERBOSE(... testing $cf_cv_library_path_$3)
+ CPPFLAGS="$cf_test_CPPFLAGS"
+ LIBS="-l$3 $7 $cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
+ AC_TRY_LINK([$1],[$2],[
+ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
+ cf_cv_find_linkage_$3=yes
+ cf_cv_library_file_$3="-l$3"
+ break],[
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS"
+ ])
+ fi
+ done
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LDFLAGS="$cf_save_LDFLAGS"
+ fi
+
+ else
+ cf_cv_find_linkage_$3=no
+ fi
+ ],$7)
])
LIBS="$cf_save_LIBS"
@@ -1262,7 +1507,7 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_CURSES_VERSION version: 6 updated: 2012/10/06 16:39:58
+dnl CF_FUNC_CURSES_VERSION version: 7 updated: 2017/05/10 18:31:29
dnl ----------------------
dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
dnl It's a character string "SVR4", not documented.
@@ -1271,7 +1516,7 @@ AC_DEFUN([CF_FUNC_CURSES_VERSION],
AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[
AC_TRY_RUN([
#include <${cf_cv_ncurses_header:-curses.h}>
-int main()
+int main(void)
{
char temp[1024];
sprintf(temp, "%s\n", curses_version());
@@ -1284,7 +1529,35 @@ rm -f core])
test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION,1,[Define to 1 if we have curses_version function])
])
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
+dnl CF_FUNC_OPENPTY version: 5 updated: 2015/09/12 14:46:50
+dnl ---------------
+dnl Check for openpty() function, along with <pty.h> header. It may need the
+dnl "util" library as well.
+AC_DEFUN([CF_FUNC_OPENPTY],
+[
+AC_CHECK_LIB(util,openpty,cf_cv_lib_util=yes,cf_cv_lib_util=no)
+AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[
+ cf_save_LIBS="$LIBS"
+ test $cf_cv_lib_util = yes && { CF_ADD_LIB(util) }
+ for cf_header in pty.h libutil.h util.h
+ do
+ AC_TRY_LINK([
+#include <$cf_header>
+],[
+ int x = openpty((int *)0, (int *)0, (char *)0,
+ (struct termios *)0, (struct winsize *)0);
+],[
+ cf_cv_func_openpty=$cf_header
+ break
+],[
+ cf_cv_func_openpty=no
+])
+ done
+ LIBS="$cf_save_LIBS"
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
@@ -1338,20 +1611,20 @@ EOF
cf_directive="__attribute__(($cf_attribute))"
echo "checking for $CC $cf_directive" 1>&AC_FD_CC
- case $cf_attribute in #(vi
- printf) #(vi
+ case $cf_attribute in
+ (printf)
cf_printf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- scanf) #(vi
+ (scanf)
cf_scanf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- *) #(vi
+ (*)
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE $cf_directive
EOF
@@ -1361,11 +1634,11 @@ EOF
if AC_TRY_EVAL(ac_compile); then
test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
cat conftest.h >>confdefs.h
- case $cf_attribute in #(vi
- noreturn) #(vi
+ case $cf_attribute in
+ (noreturn)
AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
;;
- printf) #(vi
+ (printf)
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
@@ -1373,7 +1646,7 @@ EOF
fi
AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
- scanf) #(vi
+ (scanf)
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
@@ -1381,7 +1654,7 @@ EOF
fi
AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
;;
- unused) #(vi
+ (unused)
AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
@@ -1394,9 +1667,10 @@ rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
+dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36
dnl --------------
-dnl Find version of gcc
+dnl Find version of gcc, and (because icc/clang pretend to be gcc without being
+dnl compatible), attempt to determine if icc/clang is actually used.
AC_DEFUN([CF_GCC_VERSION],[
AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
@@ -1406,14 +1680,17 @@ if test "$GCC" = yes ; then
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
+CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 31 updated: 2013/11/19 19:23:35
+dnl CF_GCC_WARNINGS version: 37 updated: 2020/01/05 20:04:12
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
dnl
dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
+dnl -Winline (usually not worthwhile)
dnl -Wredundant-decls (system headers make this too noisy)
dnl -Wtraditional (combines too many unrelated messages, only a few useful)
dnl -Wwrite-strings (too noisy, but should review occasionally). This
@@ -1430,14 +1707,11 @@ dnl
AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
-CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
-CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
-
+if test "x$have_x" = xyes; then CF_CONST_X_STRING fi
cat > conftest.$ac_ext <<EOF
#line __oline__ "${as_me:-configure}"
int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
EOF
-
if test "$INTEL_COMPILER" = yes
then
# The "-wdXXX" options suppress warnings:
@@ -1472,8 +1746,7 @@ then
fi
done
CFLAGS="$cf_save_CFLAGS"
-
-elif test "$GCC" = yes
+elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
then
AC_CHECKING([for $CC warning options])
cf_save_CFLAGS="$CFLAGS"
@@ -1495,25 +1768,22 @@ then
Wpointer-arith \
Wshadow \
Wstrict-prototypes \
- Wundef $cf_gcc_warnings $cf_warn_CONST $1
+ Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST $1
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
if AC_TRY_EVAL(ac_compile); then
test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
- case $cf_opt in #(vi
- Wcast-qual) #(vi
- CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
- ;;
- Winline) #(vi
+ case $cf_opt in
+ (Winline)
case $GCC_VERSION in
- [[34]].*)
+ ([[34]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
;;
- Wpointer-arith) #(vi
+ (Wpointer-arith)
case $GCC_VERSION in
- [[12]].*)
+ ([[12]].*)
CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
continue;;
esac
@@ -1555,7 +1825,7 @@ if test $cf_cv_getopt_header = getopt.h ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
+dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41
dnl -------------
dnl Check if we must define _GNU_SOURCE to get a reasonable value for
dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
@@ -1563,29 +1833,110 @@ dnl (or misfeature) of glibc2, which breaks portability of many applications,
dnl since it is interwoven with GNU extensions.
dnl
dnl Well, yes we could work around it...
+dnl
+dnl Parameters:
+dnl $1 is the nominal value for _XOPEN_SOURCE
AC_DEFUN([CF_GNU_SOURCE],
[
-AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
+cf_gnu_xopen_source=ifelse($1,,500,$1)
+
+AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[
AC_TRY_COMPILE([#include <sys/types.h>],[
-#ifndef _XOPEN_SOURCE
-make an error
-#endif],
- [cf_cv_gnu_source=no],
- [cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
- AC_TRY_COMPILE([#include <sys/types.h>],[
-#ifdef _XOPEN_SOURCE
-make an error
-#endif],
- [cf_cv_gnu_source=no],
- [cf_cv_gnu_source=yes])
- CPPFLAGS="$cf_save"
- ])
+ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
+ return 0;
+ #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
+ return 0;
+ #else
+ # error not GNU C library
+ #endif],
+ [cf_cv_gnu_library=yes],
+ [cf_cv_gnu_library=no])
])
-test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+if test x$cf_cv_gnu_library = xyes; then
+
+ # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
+ # was changed to help a little. newlib incorporated the change about 4
+ # years later.
+ AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[
+ cf_save="$CPPFLAGS"
+ CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
+ AC_TRY_COMPILE([#include <sys/types.h>],[
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
+ return 0;
+ #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
+ return 0;
+ #else
+ # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
+ #endif],
+ [cf_cv_gnu_library_219=yes],
+ [cf_cv_gnu_library_219=no])
+ CPPFLAGS="$cf_save"
+ ])
+
+ if test "x$cf_cv_gnu_library_219" = xyes; then
+ cf_save="$CPPFLAGS"
+ AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[
+ CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source)
+ AC_TRY_COMPILE([
+ #include <limits.h>
+ #include <sys/types.h>
+ ],[
+ #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
+ return 0;
+ #else
+ # error GNU C library is too old
+ #endif],
+ [cf_cv_gnu_dftsrc_219=yes],
+ [cf_cv_gnu_dftsrc_219=no])
+ ])
+ test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
+ else
+ cf_cv_gnu_dftsrc_219=maybe
+ fi
+
+ if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
+
+ AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[
+ #ifndef _XOPEN_SOURCE
+ #error expected _XOPEN_SOURCE to be defined
+ #endif],
+ [cf_cv_gnu_source=no],
+ [cf_save="$CPPFLAGS"
+ CF_ADD_CFLAGS(-D_GNU_SOURCE)
+ AC_TRY_COMPILE([#include <sys/types.h>],[
+ #ifdef _XOPEN_SOURCE
+ #error expected _XOPEN_SOURCE to be undefined
+ #endif],
+ [cf_cv_gnu_source=no],
+ [cf_cv_gnu_source=yes])
+ CPPFLAGS="$cf_save"
+ ])
+ ])
+
+ if test "$cf_cv_gnu_source" = yes
+ then
+ AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[
+ CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE)
+ AC_TRY_COMPILE([#include <sys/types.h>],[
+ #ifdef _DEFAULT_SOURCE
+ #error expected _DEFAULT_SOURCE to be undefined
+ #endif],
+ [cf_cv_default_source=no],
+ [cf_cv_default_source=yes])
+ ])
+ if test "$cf_cv_default_source" = yes
+ then
+ CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
+ fi
+ fi
+ fi
+
+fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
+dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48
dnl --------------
dnl Construct a search-list of directories for a nonstandard header-file
dnl
@@ -1601,8 +1952,8 @@ cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
for cf_header_path in $CPPFLAGS $CFLAGS
do
- case $cf_header_path in #(vi
- -I*)
+ case $cf_header_path in
+ (-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
cf_header_path_list="$cf_header_path_list [$]$1"
@@ -1631,11 +1982,12 @@ test -d "$oldincludedir" && {
$1="[$]$1 $cf_header_path_list"
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
+dnl CF_HELP_MESSAGE version: 4 updated: 2019/12/31 08:53:54
dnl ---------------
dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
AC_DEFUN([CF_HELP_MESSAGE],
-[AC_DIVERT_HELP([$1])dnl
+[CF_ACVERSION_CHECK(2.53,[],[
+AC_DIVERT_HELP($1)])dnl
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42
@@ -1646,7 +1998,101 @@ AC_DEFUN([CF_INHERIT_SCRIPT],
test -f $1 || ( test -f ../$1 && cp ../$1 ./ )
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 6 updated: 2014/03/17 13:13:07
+dnl CF_INSTALL_OPTS version: 2 updated: 2018/08/18 12:19:21
+dnl ---------------
+dnl prompt for/fill-in useful install-program options
+AC_DEFUN([CF_INSTALL_OPTS],
+[
+CF_INSTALL_OPT_S
+CF_INSTALL_OPT_P
+CF_INSTALL_OPT_O
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INSTALL_OPT_O version: 2 updated: 2015/05/15 19:45:35
+dnl ----------------
+dnl Almost all "install" programs default to the current user's ownership.
+dnl Almost - MINIX is an exception.
+AC_DEFUN([CF_INSTALL_OPT_O],
+[
+AC_MSG_CHECKING(if install needs to be told about ownership)
+case `$ac_config_guess` in
+(*minix)
+ with_install_o=yes
+ ;;
+(*)
+ with_install_o=no
+ ;;
+esac
+
+AC_MSG_RESULT($with_install_o)
+if test "x$with_install_o" = xyes
+then
+ INSTALL_OPT_O=`id root|sed -e 's/uid=[[0-9]]*(/ -o /' -e 's/gid=[[0-9]]*(/ -g /' -e 's/ [[^=[:space:]]][[^=[:space:]]]*=.*/ /' -e 's/)//g'`
+else
+ INSTALL_OPT_O=
+fi
+
+AC_SUBST(INSTALL_OPT_O)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INSTALL_OPT_P version: 1 updated: 2018/08/18 12:19:21
+dnl ----------------
+dnl Some install-programs accept a "-p" option to preserve file modification
+dnl timestamps. That can be useful as an install option, as well as a way to
+dnl avoid the need for ranlib after copying a static archive.
+AC_DEFUN([CF_INSTALL_OPT_P],
+[
+: ${INSTALL:=install}
+AC_CACHE_CHECK(if install accepts -p option, cf_cv_install_p,[
+ rm -rf conftest*
+ date >conftest.in
+ mkdir conftest.out
+ sleep 3
+ if $INSTALL -p conftest.in conftest.out 2>/dev/null
+ then
+ if test -f conftest.out/conftest.in
+ then
+ test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
+ test conftest.out/conftest.in -nt conftest.in 2>conftest.err
+ if test -s conftest.err
+ then
+ cf_cv_install_p=no
+ else
+ cf_cv_install_p=yes
+ fi
+ else
+ cf_cv_install_p=no
+ fi
+ else
+ cf_cv_install_p=no
+ fi
+ rm -rf conftest*
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INSTALL_OPT_S version: 2 updated: 2018/08/18 12:19:21
+dnl ----------------
+dnl By default, we should strip executables which are installed, but leave the
+dnl ability to suppress that for unit-testing.
+AC_DEFUN([CF_INSTALL_OPT_S],
+[
+AC_MSG_CHECKING(if you want to install stripped executables)
+CF_ARG_DISABLE(stripping,
+ [ --disable-stripping do not strip (debug info) installed executables],
+ [with_stripping=no],
+ [with_stripping=yes])
+AC_MSG_RESULT($with_stripping)
+
+if test "$with_stripping" = yes
+then
+ INSTALL_OPT_S="-s"
+else
+ INSTALL_OPT_S=
+fi
+AC_SUBST(INSTALL_OPT_S)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@@ -1665,7 +2111,7 @@ ifelse([$2],,INTEL_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
case $host_os in
- linux*|gnu*)
+ (linux*|gnu*)
AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
@@ -1684,7 +2130,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147"
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_LD_RPATH_OPT version: 5 updated: 2011/07/17 14:48:41
+dnl CF_LD_RPATH_OPT version: 8 updated: 2018/08/18 16:36:35
dnl ---------------
dnl For the given system and compiler, find the compiler flags to pass to the
dnl loader to use the "rpath" feature.
@@ -1693,52 +2139,55 @@ AC_DEFUN([CF_LD_RPATH_OPT],
AC_REQUIRE([CF_CHECK_CACHE])
LD_RPATH_OPT=
-AC_MSG_CHECKING(for an rpath option)
-case $cf_cv_system_name in #(vi
-irix*) #(vi
- if test "$GCC" = yes; then
+if test "x$cf_cv_enable_rpath" != xno
+then
+ AC_MSG_CHECKING(for an rpath option)
+ case $cf_cv_system_name in
+ (irix*)
+ if test "$GCC" = yes; then
+ LD_RPATH_OPT="-Wl,-rpath,"
+ else
+ LD_RPATH_OPT="-rpath "
+ fi
+ ;;
+ (linux*|gnu*|k*bsd*-gnu|freebsd*)
LD_RPATH_OPT="-Wl,-rpath,"
- else
+ ;;
+ (openbsd[[2-9]].*|mirbsd*)
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+ (dragonfly*)
LD_RPATH_OPT="-rpath "
- fi
- ;;
-linux*|gnu*|k*bsd*-gnu) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-openbsd[[2-9]].*|mirbsd*) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-dragonfly*|freebsd*) #(vi
- LD_RPATH_OPT="-rpath "
- ;;
-netbsd*) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-osf*|mls+*) #(vi
- LD_RPATH_OPT="-rpath "
- ;;
-solaris2*) #(vi
- LD_RPATH_OPT="-R"
- ;;
-*)
- ;;
-esac
-AC_MSG_RESULT($LD_RPATH_OPT)
+ ;;
+ (netbsd*)
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+ (osf*|mls+*)
+ LD_RPATH_OPT="-rpath "
+ ;;
+ (solaris2*)
+ LD_RPATH_OPT="-R"
+ ;;
+ (*)
+ ;;
+ esac
+ AC_MSG_RESULT($LD_RPATH_OPT)
-case "x$LD_RPATH_OPT" in #(vi
-x-R*)
- AC_MSG_CHECKING(if we need a space after rpath option)
- cf_save_LIBS="$LIBS"
- CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
- AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
- LIBS="$cf_save_LIBS"
- AC_MSG_RESULT($cf_rpath_space)
- test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
- ;;
-esac
+ case "x$LD_RPATH_OPT" in
+ (x-R*)
+ AC_MSG_CHECKING(if we need a space after rpath option)
+ cf_save_LIBS="$LIBS"
+ CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
+ AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
+ LIBS="$cf_save_LIBS"
+ AC_MSG_RESULT($cf_rpath_space)
+ test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+ ;;
+ esac
+fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
+dnl CF_LIBRARY_PATH version: 10 updated: 2015/04/15 19:08:48
dnl ---------------
dnl Construct a search-list of directories for a nonstandard library-file
dnl
@@ -1752,8 +2201,8 @@ cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
for cf_library_path in $LDFLAGS $LIBS
do
- case $cf_library_path in #(vi
- -L*)
+ case $cf_library_path in
+ (-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
cf_library_path_list="$cf_library_path_list [$]$1"
@@ -1804,7 +2253,7 @@ AC_SUBST(MAKE_UPPER_TAGS)
AC_SUBST(MAKE_LOWER_TAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02
+dnl CF_MATH_LIB version: 9 updated: 2017/01/21 11:06:25
dnl -----------
dnl Checks for libraries. At least one UNIX system, Apple Macintosh
dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
@@ -1815,6 +2264,7 @@ AC_CACHE_CHECK(if -lm needed for math functions,
cf_cv_need_libm,[
AC_TRY_LINK([
#include <stdio.h>
+ #include <stdlib.h>
#include <math.h>
],
[double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)],
@@ -1828,7 +2278,7 @@ ifelse($1,,[
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 6 updated: 2013/10/08 17:47:05
+dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00
dnl ----------------------
dnl Check if the file-system supports mixed-case filenames. If we're able to
dnl create a lowercase name and see it as uppercase, it doesn't support that.
@@ -1836,11 +2286,11 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES],
[
AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
if test "$cross_compiling" = yes ; then
- case $target_alias in #(vi
- *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
+ case $target_alias in
+ (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
cf_cv_mixedcase=no
;;
- *)
+ (*)
cf_cv_mixedcase=yes
;;
esac
@@ -1899,46 +2349,97 @@ printf("old\n");
,[$1=no])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 10 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_CONFIG version: 21 updated: 2018/06/20 20:23:13
dnl -----------------
-dnl Tie together the configure-script macros for ncurses.
-dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
-dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
+dnl Tie together the configure-script macros for ncurses, preferring these in
+dnl order:
+dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG
+dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG
+dnl c) just plain libraries
dnl
dnl $1 is the root library name (default: "ncurses")
-AC_DEFUN([CF_NCURSES_CONFIG],
-[
+AC_DEFUN([CF_NCURSES_CONFIG],[
+AC_REQUIRE([CF_PKG_CONFIG])
cf_ncuconfig_root=ifelse($1,,ncurses,$1)
+cf_have_ncuconfig=no
-echo "Looking for ${cf_ncuconfig_root}-config"
+if test "x${PKG_CONFIG:=none}" != xnone; then
+ AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root)
+ if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
+ AC_MSG_RESULT(yes)
-CF_ACVERSION_CHECK(2.52,
- [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
- [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
+ AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work)
+ cf_have_ncuconfig=unknown
-if test "$NCURSES_CONFIG" != none ; then
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
+ CF_ADD_CFLAGS(`$PKG_CONFIG --cflags $cf_ncuconfig_root`)
+ CF_ADD_LIBS(`$PKG_CONFIG --libs $cf_ncuconfig_root`)
-# even with config script, some packages use no-override for curses.h
-CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
+ AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+ [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
+ [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
+ int main(void)
+ { char *xx = curses_version(); return (xx == 0); }],
+ [cf_have_ncuconfig=yes],
+ [cf_have_ncuconfig=no],
+ [cf_have_ncuconfig=maybe])],
+ [cf_have_ncuconfig=no])
+ AC_MSG_RESULT($cf_have_ncuconfig)
+ test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
+ if test "$cf_have_ncuconfig" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ NCURSES_CONFIG_PKG=none
+ else
+ AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
+ NCURSES_CONFIG_PKG=$cf_ncuconfig_root
+ CF_TERM_HEADER
+ fi
-dnl like CF_NCURSES_CPPFLAGS
-AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
+ else
+ AC_MSG_RESULT(no)
+ NCURSES_CONFIG_PKG=none
+ fi
+else
+ NCURSES_CONFIG_PKG=none
+fi
-dnl like CF_NCURSES_LIBS
-CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
-AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+if test "x$cf_have_ncuconfig" = "xno"; then
+ cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
-dnl like CF_NCURSES_VERSION
-cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+ CF_ACVERSION_CHECK(2.52,
+ [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
+ [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
-else
+ if test "$NCURSES_CONFIG" != none ; then
+
+ CF_ADD_CFLAGS(`$NCURSES_CONFIG --cflags`)
+ CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
+
+ # even with config script, some packages use no-override for curses.h
+ CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
+
+ dnl like CF_NCURSES_CPPFLAGS
+ AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
-CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
-CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+ dnl like CF_NCURSES_LIBS
+ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
+ AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+
+ dnl like CF_NCURSES_VERSION
+ cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+ else
+ CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
+ CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+
+ fi
+else
+ NCURSES_CONFIG=none
fi
])dnl
dnl ---------------------------------------------------------------------------
@@ -2028,7 +2529,7 @@ AC_TRY_LINK([
test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extensions])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 3 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_HEADER version: 4 updated: 2015/04/15 19:08:48
dnl -----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs.
@@ -2077,24 +2578,24 @@ fi
# Set definitions to allow ifdef'ing for ncurses.h
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
+case $cf_cv_ncurses_header in
+(*ncurses.h)
AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
;;
esac
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
+case $cf_cv_ncurses_header in
+(ncurses/curses.h|ncurses/ncurses.h)
AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
;;
-ncursesw/curses.h|ncursesw/ncurses.h)
+(ncursesw/curses.h|ncursesw/ncurses.h)
AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38
+dnl CF_NCURSES_LIBS version: 17 updated: 2015/04/15 19:08:48
dnl ---------------
dnl Look for the ncurses library. This is a little complicated on Linux,
dnl because it may be linked with the gpm (general purpose mouse) library.
@@ -2120,8 +2621,8 @@ AC_CHECK_LIB(gpm,Gpm_Open,
[LIBS="$cf_ncurses_SAVE"],
[cf_ncurses_LIBS="-lgpm"])])
-case $host_os in #(vi
-freebsd*)
+case $host_os in
+(freebsd*)
# This is only necessary if you are linking against an obsolete
# version of ncurses (but it should do no harm, since it's static).
if test "$cf_nculib_root" = ncurses ; then
@@ -2162,7 +2663,22 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 14 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_PTHREADS version: 2 updated: 2016/04/22 05:07:41
+dnl -------------------
+dnl Use this followup check to ensure that we link with pthreads if ncurses
+dnl uses it.
+AC_DEFUN([CF_NCURSES_PTHREADS],[
+: ${cf_nculib_root:=ifelse($1,,ncurses,$1)}
+AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads,
+ cf_cv_ncurses_pthreads=yes,
+ cf_cv_ncurses_pthreads=no)
+if test "$cf_cv_ncurses_pthreads" = yes
+then
+ CF_ADD_LIBS(-lpthread)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_VERSION version: 15 updated: 2017/05/09 19:26:10
dnl ------------------
dnl Check for the version of ncurses, to aid in reporting bugs, etc.
dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
@@ -2177,7 +2693,7 @@ AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
AC_TRY_RUN([
#include <${cf_cv_ncurses_header:-curses.h}>
#include <stdio.h>
-int main()
+int main(void)
{
FILE *fp = fopen("$cf_tempfile", "w");
#ifdef NCURSES_VERSION
@@ -2279,7 +2795,7 @@ AC_TRY_COMPILE([
test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H,1,[Define to 1 if we appear to be using NetBSD menu.h])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03
+dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
@@ -2295,12 +2811,12 @@ AC_ARG_WITH($1,
[with_$1=])
AC_MSG_RESULT(${with_$1:-no})
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
+case .$with_cflags in
+(.*-g*)
+ case .$CFLAGS in
+ (.*-g*)
;;
- *)
+ (*)
CF_ADD_CFLAGS([-g])
;;
esac
@@ -2308,7 +2824,7 @@ case .$with_cflags in #(vi
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 14 updated: 2012/06/19 20:58:54
+dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57
dnl --------------
dnl Check the argument to see that it looks like a pathname. Rewrite it if it
dnl begins with one of the prefix/exec_prefix variables, and then again if the
@@ -2316,36 +2832,36 @@ dnl result begins with 'NONE'. This is necessary to work around autoconf's
dnl delayed evaluation of those symbols.
AC_DEFUN([CF_PATH_SYNTAX],[
if test "x$prefix" != xNONE; then
- cf_path_syntax="$prefix"
+ cf_path_syntax="$prefix"
else
- cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".[$]$1" in #(vi
-.\[$]\(*\)*|.\'*\'*) #(vi
- ;;
-..|./*|.\\*) #(vi
- ;;
-.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
- ;;
-.\[$]{*prefix}*|.\[$]{*dir}*) #(vi
- eval $1="[$]$1"
- case ".[$]$1" in #(vi
- .NONE/*)
- $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
- ;;
- esac
- ;; #(vi
-.no|.NONE/*)
- $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
- ;;
-*)
- ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
- ;;
+ cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".[$]$1" in
+(.\[$]\(*\)*|.\'*\'*)
+ ;;
+(..|./*|.\\*)
+ ;;
+(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
+ ;;
+(.\[$]{*prefix}*|.\[$]{*dir}*)
+ eval $1="[$]$1"
+ case ".[$]$1" in
+ (.NONE/*)
+ $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;;
+(.no|.NONE/*)
+ $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+(*)
+ ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
+ ;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PDCURSES_X11 version: 13 updated: 2012/10/06 16:39:58
+dnl CF_PDCURSES_X11 version: 14 updated: 2018/06/20 20:23:13
dnl ---------------
dnl Configure for PDCurses' X11 library
AC_DEFUN([CF_PDCURSES_X11],[
@@ -2357,7 +2873,7 @@ CF_ACVERSION_CHECK(2.52,
if test "$XCURSES_CONFIG" != none ; then
-CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
+CF_ADD_CFLAGS(`$XCURSES_CONFIG --cflags`)
CF_ADD_LIBS(`$XCURSES_CONFIG --libs`)
cf_cv_lib_XCurses=yes
@@ -2390,7 +2906,7 @@ else
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PKG_CONFIG version: 7 updated: 2011/04/29 04:53:22
+dnl CF_PKG_CONFIG version: 10 updated: 2015/04/26 18:06:58
dnl -------------
dnl Check for the package-config program, unless disabled by command-line.
AC_DEFUN([CF_PKG_CONFIG],
@@ -2402,16 +2918,16 @@ AC_ARG_WITH(pkg-config,
[cf_pkg_config=yes])
AC_MSG_RESULT($cf_pkg_config)
-case $cf_pkg_config in #(vi
-no) #(vi
+case $cf_pkg_config in
+(no)
PKG_CONFIG=none
;;
-yes) #(vi
+(yes)
CF_ACVERSION_CHECK(2.52,
[AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
[AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
;;
-*)
+(*)
PKG_CONFIG=$withval
;;
esac
@@ -2419,12 +2935,14 @@ esac
test -z "$PKG_CONFIG" && PKG_CONFIG=none
if test "$PKG_CONFIG" != none ; then
CF_PATH_SYNTAX(PKG_CONFIG)
+elif test "x$cf_pkg_config" != xno ; then
+ AC_MSG_WARN(pkg-config is not installed)
fi
AC_SUBST(PKG_CONFIG)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
+dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17
dnl -----------------
dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
dnl
@@ -2439,7 +2957,10 @@ dnl
dnl Parameters:
dnl $1 is the nominal value for _POSIX_C_SOURCE
AC_DEFUN([CF_POSIX_C_SOURCE],
-[
+[AC_REQUIRE([CF_POSIX_VISIBLE])dnl
+
+if test "$cf_cv_posix_visible" = no; then
+
cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
cf_save_CFLAGS="$CFLAGS"
@@ -2456,15 +2977,15 @@ make an error
#endif],
[cf_cv_posix_c_source=no],
[cf_want_posix_source=no
- case .$cf_POSIX_C_SOURCE in #(vi
- .[[12]]??*) #(vi
+ case .$cf_POSIX_C_SOURCE in
+ (.[[12]]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
- .2) #(vi
+ (.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
- .*)
+ (.*)
cf_want_posix_source=yes
;;
esac
@@ -2477,7 +2998,8 @@ make an error
fi
CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
CFLAGS="$cf_trim_CFLAGS"
- CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+ CPPFLAGS="$cf_trim_CPPFLAGS"
+ CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source)
CF_MSG_LOG(if the second compile does not leave our definition intact error)
AC_TRY_COMPILE([#include <sys/types.h>],[
#ifndef _POSIX_C_SOURCE
@@ -2495,6 +3017,35 @@ if test "$cf_cv_posix_c_source" != no ; then
CF_ADD_CFLAGS($cf_cv_posix_c_source)
fi
+fi # cf_cv_posix_visible
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17
+dnl ----------------
+dnl POSIX documents test-macros which an application may set before any system
+dnl headers are included to make features available.
+dnl
+dnl Some BSD platforms (originally FreeBSD, but copied by a few others)
+dnl diverged from POSIX in 2002 by setting symbols which make all of the most
+dnl recent features visible in the system header files unless the application
+dnl overrides the corresponding test-macros. Doing that introduces portability
+dnl problems.
+dnl
+dnl This macro makes a special check for the symbols used for this, to avoid a
+dnl conflicting definition.
+AC_DEFUN([CF_POSIX_VISIBLE],
+[
+AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[
+AC_TRY_COMPILE([#include <stdio.h>],[
+#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
+ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
+ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
+ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
+#error conflicting symbols found
+#endif
+],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes])
+])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PRG_RULES version: 1 updated: 2006/06/03 11:45:08
@@ -2521,11 +3072,15 @@ done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58
+dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54
dnl ----------
dnl standard check for CC, plus followup sanity checks
dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
AC_DEFUN([CF_PROG_CC],[
+CF_ACVERSION_CHECK(2.53,
+ [AC_MSG_WARN(this will incorrectly handle gnatgcc choice)
+ AC_REQUIRE([AC_PROG_CC])],
+ [])
ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
CF_GCC_VERSION
CF_ACVERSION_CHECK(2.52,
@@ -2534,7 +3089,7 @@ CF_ACVERSION_CHECK(2.52,
CF_CC_ENV_FLAGS
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
+dnl CF_PROG_INSTALL version: 7 updated: 2015/04/18 08:56:57
dnl ---------------
dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the
dnl misc/tabset install won't work properly. Usually this happens only when
@@ -2542,21 +3097,26 @@ dnl using the fallback mkinstalldirs script
AC_DEFUN([CF_PROG_INSTALL],
[AC_PROG_INSTALL
case $INSTALL in
-/*)
- ;;
-*)
- CF_DIRNAME(cf_dir,$INSTALL)
- test -z "$cf_dir" && cf_dir=.
- INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
- ;;
+(/*)
+ ;;
+(*)
+ CF_DIRNAME(cf_dir,$INSTALL)
+ test -z "$cf_dir" && cf_dir=.
+ INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
+ ;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
+dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37
dnl ------------
AC_DEFUN([CF_PROG_LINT],
[
-AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
+AC_CHECK_PROGS(LINT, lint cppcheck splint)
+case "x$LINT" in
+(xcppcheck|x*/cppcheck)
+ test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
+ ;;
+esac
AC_SUBST(LINT_OPTS)
])dnl
dnl ---------------------------------------------------------------------------
@@ -2577,6 +3137,17 @@ $1=`echo "$2" | \
-e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45
+dnl ---------------------
+dnl Restore flags saved in CF_SAVE_XTRA_FLAGS
+dnl $1 = name of current macro
+define([CF_RESTORE_XTRA_FLAGS],
+[
+LIBS="$cf_save_LIBS_$1"
+CFLAGS="$cf_save_CFLAGS_$1"
+CPPFLAGS="$cf_save_CPPFLAGS_$1"
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_RPATH_HACK version: 11 updated: 2013/09/01 13:02:00
dnl -------------
AC_DEFUN([CF_RPATH_HACK],
@@ -2634,7 +3205,7 @@ fi
AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24
+dnl CF_RPATH_HACK_2 version: 7 updated: 2015/04/12 15:39:00
dnl ---------------
dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
dnl EXTRA_LDFLAGS for each -L option found.
@@ -2650,8 +3221,8 @@ CF_VERBOSE(...checking $1 [$]$1)
cf_rpath_dst=
for cf_rpath_src in [$]$1
do
- case $cf_rpath_src in #(vi
- -L*) #(vi
+ case $cf_rpath_src in
+ (-L*)
# check if this refers to a directory which we will ignore
cf_rpath_skip=no
@@ -2694,9 +3265,93 @@ CF_VERBOSE(...checked $1 [$]$1)
AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SIG_ATOMIC_T version: 3 updated: 2012/10/04 20:12:20
+dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44
+dnl ------------------
+dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers
+dnl and libraries which do not update those variables.
+dnl
+dnl $1 = name of current macro
+define([CF_SAVE_XTRA_FLAGS],
+[
+cf_save_LIBS_$1="$LIBS"
+cf_save_CFLAGS_$1="$CFLAGS"
+cf_save_CPPFLAGS_$1="$CPPFLAGS"
+LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
+for cf_X_CFLAGS in $X_CFLAGS
+do
+ case "x$cf_X_CFLAGS" in
+ x-[[IUD]]*)
+ CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS $cf_X_CFLAGS"
+ ;;
+ esac
+done
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SIGWINCH version: 2 updated: 2019/03/23 19:54:44
+dnl -----------
+dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
+dnl programs need this test).
+dnl
+dnl This is really a Mac OS X 10.4.3 workaround. Defining _POSIX_C_SOURCE
+dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct
+dnl winsize declaration is left alone - we may revisit this if Apple choose to
+dnl break that part of the interface as well.
+AC_DEFUN([CF_SIGWINCH],
+[
+AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/signal.h>
+],[int x = SIGWINCH],
+ [cf_cv_define_sigwinch=yes],
+ [AC_TRY_COMPILE([
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+],[int x = SIGWINCH],
+ [cf_cv_define_sigwinch=maybe],
+ [cf_cv_define_sigwinch=no])
+])
+])
+
+if test "$cf_cv_define_sigwinch" = maybe ; then
+AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[
+cf_cv_fixup_sigwinch=unknown
+cf_sigwinch=32
+while test $cf_sigwinch != 1
+do
+ AC_TRY_COMPILE([
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+],[
+#if SIGWINCH != $cf_sigwinch
+make an error
+#endif
+int x = SIGWINCH],
+ [cf_cv_fixup_sigwinch=$cf_sigwinch
+ break])
+
+cf_sigwinch=`expr $cf_sigwinch - 1`
+done
+])
+
+ if test "$cf_cv_fixup_sigwinch" != unknown ; then
+ CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
+ fi
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SIG_ATOMIC_T version: 4 updated: 2020/01/18 12:30:44
dnl ---------------
-dnl signal handler, but there are some gcc depedencies in that recommendation.
+dnl signal handler, but there are some gcc dependencies in that recommendation.
dnl Try anyway.
AC_DEFUN([CF_SIG_ATOMIC_T],
[
@@ -2753,7 +3408,7 @@ do
done
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SYS_TIME_SELECT version: 5 updated: 2012/10/04 05:24:07
+dnl CF_SYS_TIME_SELECT version: 6 updated: 2015/04/18 08:56:57
dnl ------------------
dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
dnl older SCO configurations.
@@ -2770,24 +3425,24 @@ AC_TRY_COMPILE([
#include <sys/select.h>
#endif
],[],[cf_cv_sys_time_select=yes],
- [cf_cv_sys_time_select=no])
- ])
+ [cf_cv_sys_time_select=no])
+ ])
AC_MSG_RESULT($cf_cv_sys_time_select)
test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include <sys/time.h> with <sys/select.h>])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 3 updated: 2012/10/06 08:57:51
+dnl CF_TERM_HEADER version: 4 updated: 2015/04/15 19:08:48
dnl --------------
dnl Look for term.h, which is part of X/Open curses. It defines the interface
dnl to terminfo database. Usually it is in the same include-path as curses.h,
dnl but some packagers change this, breaking various applications.
AC_DEFUN([CF_TERM_HEADER],[
AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
;;
-*)
+(*)
cf_term_header=term.h
;;
esac
@@ -2807,17 +3462,17 @@ done
# Set definitions to allow ifdef'ing to accommodate subdirectories
-case $cf_cv_term_header in # (vi
-*term.h)
+case $cf_cv_term_header in
+(*term.h)
AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
esac
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
+case $cf_cv_term_header in
+(ncurses/term.h)
AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
-ncursesw/term.h)
+(ncursesw/term.h)
AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
;;
esac
@@ -2832,7 +3487,7 @@ top_builddir=ifelse($1,,`pwd`,$1)
AC_SUBST(top_builddir)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TPUTS_PROTO version: 2 updated: 2011/04/23 19:25:50
+dnl CF_TPUTS_PROTO version: 3 updated: 2015/04/17 21:26:14
dnl --------------
dnl Check for type of function-pointer passed to tputs. Some old
dnl implementations used functions that had different prototypes, making it
@@ -2858,7 +3513,7 @@ then
static $cf_ret outc($cf_arg value) { $cf_return; }
],[
- tputs("hello", 0, outc);
+ tputs("hello", 0, outc);
${cf_cv_main_return:-return}(0);
],[
CF_VERBOSE([prototype $cf_ret func($cf_arg value)])
@@ -2876,7 +3531,7 @@ EOF
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_TRIM_X_LIBS version: 2 updated: 2013/07/09 21:27:22
+dnl CF_TRIM_X_LIBS version: 3 updated: 2015/04/12 15:39:00
dnl --------------
dnl Trim extra base X libraries added as a workaround for inconsistent library
dnl dependencies returned by "new" pkg-config files.
@@ -2884,7 +3539,7 @@ AC_DEFUN([CF_TRIM_X_LIBS],[
for cf_trim_lib in Xmu Xt X11
do
case "$LIBS" in
- *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
CF_VERBOSE(..trimmed $LIBS)
;;
@@ -2919,7 +3574,7 @@ else
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50
+dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
dnl -------------------
dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
dnl can define it successfully.
@@ -2935,7 +3590,7 @@ make an error
#endif],
[cf_cv_xopen_source=no],
[cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE)
AC_TRY_COMPILE([
#include <stdlib.h>
#include <string.h>
@@ -3105,7 +3760,7 @@ if test "$with_dmalloc" = yes ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_WITH_NCURSES_ETC version: 2 updated: 2012/01/13 10:49:00
+dnl CF_WITH_NCURSES_ETC version: 5 updated: 2016/02/20 19:23:20
dnl -------------------
dnl Use this macro for programs which use any variant of "curses", e.g.,
dnl "ncurses", and "PDCurses". Programs that can use curses and some unrelated
@@ -3119,6 +3774,10 @@ CF_WITH_CURSES_DIR
cf_cv_screen=curses
AC_MSG_CHECKING(for specified curses library type)
+AC_ARG_WITH(screen,
+ [ --with-screen=XXX use specified curses-libraries],
+ [cf_cv_screen=$withval],[
+
AC_ARG_WITH(ncursesw,
[ --with-ncursesw use wide ncurses-libraries],
[cf_cv_screen=ncursesw],[
@@ -3137,26 +3796,31 @@ AC_ARG_WITH(curses-colr,
AC_ARG_WITH(curses-5lib,
[ --with-curses-5lib compile/link with SunOS 5lib curses],
- [cf_cv_screen=curses_5lib])])])])])
+ [cf_cv_screen=curses_5lib])])])])])])
AC_MSG_RESULT($cf_cv_screen)
-case $cf_cv_screen in #(vi
-curses|curses_*) #(vi
+case $cf_cv_screen in
+(curses|curses_*)
CF_CURSES_CONFIG
;;
-ncurses) #(vi
- CF_NCURSES_CONFIG
- ;;
-ncursesw) #(vi
+(ncursesw*)
CF_UTF8_LIB
- CF_NCURSES_CONFIG(ncursesw)
+ CF_NCURSES_CONFIG($cf_cv_screen)
;;
-pdcurses)
+(ncurses*)
+ CF_NCURSES_CONFIG($cf_cv_screen)
+ ;;
+(pdcurses)
CF_PDCURSES_X11
;;
+(*)
+ AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen)
+ ;;
esac
+CF_NCURSES_PTHREADS($cf_cv_screen)
+
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
@@ -3167,7 +3831,93 @@ CF_NO_LEAKS_OPTION(valgrind,
[USE_VALGRIND])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_CURSES version: 11 updated: 2011/01/18 18:15:30
+dnl CF_WITH_X11_RGB version: 2 updated: 2019/12/31 08:53:54
+dnl ---------------
+dnl Handle configure option "--with-x11-rgb", setting these shell
+dnl variables:
+dnl
+dnl $RGB_PATH is the option value, used for finding the X11 rgb file.
+dnl $no_x11_rgb is a "#" (comment) if "--without-x11-rgb" is given.
+dnl
+dnl Most Linux's use this:
+dnl /usr/share/X11/rgb.txt
+dnl Debian uses this:
+dnl /etc/X11/rgb.txt
+dnl DragonFlyBSD ports uses this:
+dnl /usr/pkg/lib/X11/rgb.txt
+dnl FreeBSD ports use these:
+dnl /usr/local/lib/X11/rgb.txt
+dnl /usr/local/share/X11/rgb.txt
+dnl Mandriva has these:
+dnl /usr/lib/X11/rgb.txt
+dnl /usr/lib64/X11/rgb.txt
+dnl NetBSD has these
+dnl /usr/X11R7/lib/X11/rgb.txt
+dnl OpenSolaris uses
+dnl 32-bit:
+dnl /usr/X11/etc/X11/rgb.txt
+dnl /usr/X11/share/X11/rgb.txt
+dnl /usr/X11/lib/X11/rgb.txt
+dnl OSX uses
+dnl /opt/local/share/X11/rgb.txt (MacPorts)
+dnl /opt/X11/share/X11/rgb.txt (non-ports)
+dnl 64-bit:
+dnl /usr/X11/etc/X11/rgb.txt
+dnl /usr/X11/share/X11/rgb.txt (perhaps)
+dnl /usr/X11/lib/amd64/X11/rgb.txt
+dnl Solaris10 uses (in this order):
+dnl /usr/openwin/lib/X11/rgb.txt
+dnl /usr/X11/lib/X11/rgb.txt
+AC_DEFUN([CF_WITH_X11_RGB],[
+AC_MSG_CHECKING(for X11 rgb file)
+AC_ARG_WITH(x11-rgb,
+ [ --with-x11-rgb=FILE file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)],
+ [RGB_PATH=$withval],
+ [RGB_PATH=auto])
+
+if test "x[$]RGB_PATH" = xauto
+then
+ RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
+ for cf_path in \
+ /opt/local/share/X11/rgb.txt \
+ /opt/X11/share/X11/rgb.txt \
+ /usr/share/X11/rgb.txt \
+ /usr/X11/share/X11/rgb.txt \
+ /usr/X11/lib/X11/rgb.txt \
+ /usr/lib/X11/rgb.txt \
+ /etc/X11/rgb.txt \
+ /usr/pkg/lib/X11/rgb.txt \
+ /usr/X11R7/lib/X11/rgb.txt \
+ /usr/X11R6/lib/X11/rgb.txt \
+ /usr/X11R5/lib/X11/rgb.txt \
+ /usr/X11R4/lib/X11/rgb.txt \
+ /usr/local/lib/X11/rgb.txt \
+ /usr/local/share/X11/rgb.txt \
+ /usr/lib64/X11/rgb.txt
+ do
+ if test -f "$cf_path" ; then
+ RGB_PATH="$cf_path"
+ break
+ fi
+ done
+else
+ cf_path=$RGB_PATH
+ CF_PATH_SYNTAX(cf_path)
+fi
+
+AC_MSG_RESULT($RGB_PATH)
+AC_SUBST(RGB_PATH)
+AC_DEFINE_UNQUOTED(RGB_PATH,"$cf_path",[Define to the full pathname of rgb.txt])
+
+no_x11_rgb=
+if test "$RGB_PATH" = no
+then
+ no_x11_rgb="#"
+fi
+AC_SUBST(no_x11_rgb)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_XOPEN_CURSES version: 14 updated: 2018/06/20 20:23:13
dnl ---------------
dnl Test if we should define X/Open source for curses, needed on Digital Unix
dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
@@ -3177,7 +3927,8 @@ dnl as getbegy(). The latter is better design, but the former is standard.
AC_DEFUN([CF_XOPEN_CURSES],
[
AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
-AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
+AC_CACHE_CHECK(definition to turn on extended curses functions,cf_cv_need_xopen_extension,[
+cf_cv_need_xopen_extension=unknown
AC_TRY_LINK([
#include <stdlib.h>
#include <${cf_cv_ncurses_header:-curses.h}>],[
@@ -3186,14 +3937,6 @@ AC_TRY_LINK([
make an error
#endif
#endif
- long x = winnstr(stdscr, "", 0);
- int x1, y1;
- getbegyx(stdscr, y1, x1)],
- [cf_cv_need_xopen_extension=no],
- [AC_TRY_LINK([
-#define _XOPEN_SOURCE_EXTENDED
-#include <stdlib.h>
-#include <${cf_cv_ncurses_header:-curses.h}>],[
#ifdef NCURSES_VERSION
cchar_t check;
int check2 = curs_set((int)sizeof(check));
@@ -3201,12 +3944,35 @@ AC_TRY_LINK([
long x = winnstr(stdscr, "", 0);
int x1, y1;
getbegyx(stdscr, y1, x1)],
- [cf_cv_need_xopen_extension=yes],
- [cf_cv_need_xopen_extension=unknown])])])
-test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+ [cf_cv_need_xopen_extension=none],
+ [
+ for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
+ do
+ AC_TRY_LINK([
+#define $cf_try_xopen_extension 1
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header:-curses.h}>],[
+#ifdef NCURSES_VERSION
+ cchar_t check;
+ int check2 = curs_set((int)sizeof(check));
+#endif
+ long x = winnstr(stdscr, "", 0);
+ int x1, y1;
+ getbegyx(stdscr, y1, x1)],
+ [cf_cv_need_xopen_extension=$cf_try_xopen_extension; break])
+ done
+ ])
+])
+
+case $cf_cv_need_xopen_extension in
+(*_*)
+ CF_APPEND_TEXT(CPPFLAGS,-D$cf_cv_need_xopen_extension)
+ ;;
+esac
+
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 48 updated: 2014/09/01 12:29:14
+dnl CF_XOPEN_SOURCE version: 55 updated: 2018/12/31 20:46:17
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -3217,26 +3983,29 @@ dnl $1 is the nominal value for _XOPEN_SOURCE
dnl $2 is the nominal value for _POSIX_C_SOURCE
AC_DEFUN([CF_XOPEN_SOURCE],[
AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([CF_POSIX_VISIBLE])
+
+if test "$cf_cv_posix_visible" = no; then
cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
cf_xopen_source=
-case $host_os in #(vi
-aix[[4-7]]*) #(vi
+case $host_os in
+(aix[[4-7]]*)
cf_xopen_source="-D_ALL_SOURCE"
;;
-cygwin|msys) #(vi
+(msys)
cf_XOPEN_SOURCE=600
;;
-darwin[[0-8]].*) #(vi
+(darwin[[0-8]].*)
cf_xopen_source="-D_APPLE_C_SOURCE"
;;
-darwin*) #(vi
+(darwin*)
cf_xopen_source="-D_DARWIN_C_SOURCE"
cf_XOPEN_SOURCE=
;;
-freebsd*|dragonfly*) #(vi
+(freebsd*|dragonfly*|midnightbsd*)
# 5.x headers associate
# _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
# _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
@@ -3244,56 +4013,56 @@ freebsd*|dragonfly*) #(vi
cf_XOPEN_SOURCE=600
cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
;;
-hpux11*) #(vi
+(hpux11*)
cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
;;
-hpux*) #(vi
+(hpux*)
cf_xopen_source="-D_HPUX_SOURCE"
;;
-irix[[56]].*) #(vi
+(irix[[56]].*)
cf_xopen_source="-D_SGI_SOURCE"
cf_XOPEN_SOURCE=
;;
-linux*|gnu*|mint*|k*bsd*-gnu) #(vi
- CF_GNU_SOURCE
+(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
+ CF_GNU_SOURCE($cf_XOPEN_SOURCE)
;;
-minix*) #(vi
+(minix*)
cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
;;
-mirbsd*) #(vi
+(mirbsd*)
# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
cf_XOPEN_SOURCE=
CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
;;
-netbsd*) #(vi
+(netbsd*)
cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
;;
-openbsd[[4-9]]*) #(vi
+(openbsd[[4-9]]*)
# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=600
;;
-openbsd*) #(vi
+(openbsd*)
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
;;
-osf[[45]]*) #(vi
+(osf[[45]]*)
cf_xopen_source="-D_OSF_SOURCE"
;;
-nto-qnx*) #(vi
+(nto-qnx*)
cf_xopen_source="-D_QNX_SOURCE"
;;
-sco*) #(vi
+(sco*)
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
-solaris2.*) #(vi
+(solaris2.*)
cf_xopen_source="-D__EXTENSIONS__"
cf_cv_xopen_source=broken
;;
-sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
cf_XOPEN_SOURCE=
cf_POSIX_C_SOURCE=
;;
-*)
+(*)
CF_TRY_XOPEN_SOURCE
CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
;;
@@ -3331,9 +4100,10 @@ make an error
CF_TRY_XOPEN_SOURCE
fi
fi
+fi # cf_cv_posix_visible
])
dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA version: 22 updated: 2014/07/12 18:57:58
+dnl CF_X_ATHENA version: 23 updated: 2015/04/12 15:39:00
dnl -----------
dnl Check for Xaw (Athena) libraries
dnl
@@ -3415,10 +4185,10 @@ int check = XmuCompareISOLatin1("big", "small")
if test "$cf_cv_xaw_compat" = no
then
# workaround for broken ".pc" files...
- case "$cf_x_athena_lib" in #(vi
- *-lXmu*) #(vi
+ case "$cf_x_athena_lib" in
+ (*-lXmu*)
;;
- *)
+ (*)
CF_VERBOSE(work around broken package)
cf_save_xmu="$LIBS"
cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
@@ -3445,12 +4215,13 @@ if test -z "$cf_x_athena_lib" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_CPPFLAGS version: 5 updated: 2010/05/26 17:35:30
+dnl CF_X_ATHENA_CPPFLAGS version: 8 updated: 2020/01/16 05:21:56
dnl --------------------
dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
[
+AC_REQUIRE([AC_PATH_XTRA])
cf_x_athena_root=ifelse([$1],,Xaw,[$1])
cf_x_athena_inc=""
@@ -3461,10 +4232,10 @@ for cf_path in default \
/usr/local
do
if test -z "$cf_x_athena_inc" ; then
- cf_save="$CPPFLAGS"
+ CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
cf_test=X11/$cf_x_athena_root/SimpleMenu.h
if test $cf_path != default ; then
- CPPFLAGS="$cf_save -I$cf_path/include"
+ CF_APPEND_TEXT(CPPFLAGS,-I$cf_path/include)
AC_MSG_CHECKING(for $cf_test in $cf_path)
else
AC_MSG_CHECKING(for $cf_test)
@@ -3475,24 +4246,23 @@ do
[cf_result=yes],
[cf_result=no])
AC_MSG_RESULT($cf_result)
+ CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
if test "$cf_result" = yes ; then
- cf_x_athena_inc=$cf_path
+ test "$cf_path" = default && cf_x_athena_inc=default
+ test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
break
- else
- CPPFLAGS="$cf_save"
fi
fi
done
if test -z "$cf_x_athena_inc" ; then
- AC_MSG_WARN(
-[Unable to successfully find Athena header files with test program])
+ AC_MSG_WARN([Unable to find Athena header files])
elif test "$cf_x_athena_inc" != default ; then
- CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
+ CF_APPEND_TEXT(CPPFLAGS,-I$cf_x_athena_inc)
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_LIBS version: 12 updated: 2011/07/17 19:55:02
+dnl CF_X_ATHENA_LIBS version: 13 updated: 2020/01/11 18:16:10
dnl ----------------
dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
@@ -3517,29 +4287,26 @@ do
"-l$cf_lib -lXpm -lXmu" \
"-l${cf_lib}_s -lXmu_s"
do
- if test -z "$cf_x_athena_lib" ; then
- cf_save="$LIBS"
- cf_test=XawSimpleMenuAddGlobalActions
- if test $cf_path != default ; then
- CF_ADD_LIBS(-L$cf_path/lib $cf_libs)
- AC_MSG_CHECKING(for $cf_libs in $cf_path)
- else
- CF_ADD_LIBS($cf_libs)
- AC_MSG_CHECKING(for $cf_test in $cf_libs)
- fi
- AC_TRY_LINK([
+ test -n "$cf_x_athena_lib" && break
+
+ CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
+ cf_test=XawSimpleMenuAddGlobalActions
+ test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
+ CF_ADD_LIBS($cf_libs)
+ AC_MSG_CHECKING(for $cf_test in $cf_libs)
+ AC_TRY_LINK([
#include <X11/Intrinsic.h>
#include <X11/$cf_x_athena_root/SimpleMenu.h>
],[
$cf_test((XtAppContext) 0)],
- [cf_result=yes],
- [cf_result=no])
- AC_MSG_RESULT($cf_result)
- if test "$cf_result" = yes ; then
- cf_x_athena_lib="$cf_libs"
- break
- fi
- LIBS="$cf_save"
+ [cf_result=yes],
+ [cf_result=no])
+ AC_MSG_RESULT($cf_result)
+ CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
+
+ if test "$cf_result" = yes ; then
+ cf_x_athena_lib="$cf_libs"
+ break
fi
done # cf_libs
test -n "$cf_x_athena_lib" && break
@@ -3551,6 +4318,7 @@ if test -z "$cf_x_athena_lib" ; then
[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
fi
+CF_ADD_LIBS($cf_x_athena_lib)
CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
])
@@ -3563,7 +4331,7 @@ CF_TRY_PKG_CONFIG(Xext,,[
[CF_ADD_LIB(Xext)])])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_X_TOOLKIT version: 22 updated: 2014/07/13 14:33:27
+dnl CF_X_TOOLKIT version: 24 updated: 2019/03/23 19:54:44
dnl ------------
dnl Check for X Toolkit libraries
AC_DEFUN([CF_X_TOOLKIT],
@@ -3571,9 +4339,9 @@ AC_DEFUN([CF_X_TOOLKIT],
AC_REQUIRE([AC_PATH_XTRA])
AC_REQUIRE([CF_CHECK_CACHE])
-# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
# in some cases has installed dummy files in the former, other cases replaced
-# it with a link to the new location). This complicates the configure script.
+# it with a link to the new location). This complicates the configure script.
# Check for that pitfall, and recover using pkg-config
#
# If none of these are set, the configuration is almost certainly broken.
@@ -3589,10 +4357,10 @@ cf_have_X_LIBS=no
CF_TRY_PKG_CONFIG(xt,[
- case "x$LIBS" in #(vi
- *-lX11*) #(vi
+ case "x$LIBS" in
+ (*-lX11*)
;;
- *)
+ (*)
# we have an "xt" package, but it may omit Xt's dependency on X11
AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
AC_TRY_LINK([
@@ -3621,12 +4389,12 @@ AC_TRY_LINK([
if test "$cf_cv_xt_ice_compat" = no
then
# workaround for broken ".pc" files used for X Toolkit.
- case "x$X_PRE_LIBS" in #(vi
- *-lICE*)
- case "x$LIBS" in #(vi
- *-lICE*) #(vi
+ case "x$X_PRE_LIBS" in
+ (*-lICE*)
+ case "x$LIBS" in
+ (*-lICE*)
;;
- *)
+ (*)
CF_VERBOSE(work around broken ICE dependency)
CF_TRY_PKG_CONFIG(ice,
[CF_TRY_PKG_CONFIG(sm)],
@@ -3664,6 +4432,24 @@ to makefile.])
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF__CURSES_DATA version: 2 updated: 2020/02/08 21:00:26
+dnl ---------------
+dnl Attempt to make a copy of a curses data item. This is needed in the
+dnl check-data configure tests when using ncurses, because the symbol may be
+dnl actually a function return-value. That could happen if the linker is
+dnl broken (does not resolve data-only references), or if ncurses is configured
+dnl to support re-entrant code.
+dnl $1 = target
+dnl $2 = source
+define([CF__CURSES_DATA],[
+#if defined($2) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
+ const void *$1 = (const void *)($2);
+#else
+ const void *$1 = &($2);
+#endif
+ fprintf(stderr, "testing linkage of $2:%p\n", (const void *)$1);
+])dnl
+dnl ---------------------------------------------------------------------------
dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49
dnl ---------------
dnl Define a reusable chunk which includes <curses.h> and <term.h> when they
diff --git a/test/background.c b/test/background.c
index 291851b..391ab1a 100644
--- a/test/background.c
+++ b/test/background.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 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,12 +27,13 @@
* authorization. *
****************************************************************************/
/*
- * $Id: background.c,v 1.15 2014/08/09 22:31:23 tom Exp $
+ * $Id: background.c,v 1.19 2020/02/02 23:34:34 tom Exp $
*/
#define NEED_COLOR_CODE 1
#define NEED_COLOR_NAME 1
#include <color_name.h>
+#include <dump_window.h>
static int default_bg = COLOR_BLACK;
static int default_fg = COLOR_WHITE;
@@ -48,24 +50,24 @@ test_background(void)
} else {
printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
}
- getch();
+ dump_window(stdscr);
printw("Initializing pair 1 to red/%s\n", color_name(default_bg));
init_pair(1, COLOR_RED, (NCURSES_COLOR_T) default_bg);
bkgdset((chtype) (' ' | COLOR_PAIR(1)));
printw("RED/BLACK\n");
- getch();
+ dump_window(stdscr);
printw("Initializing pair 2 to %s/blue\n", color_name(default_fg));
init_pair(2, (NCURSES_COLOR_T) default_fg, COLOR_BLUE);
bkgdset((chtype) (' ' | COLOR_PAIR(2)));
printw("This line should be %s/blue\n", color_name(default_fg));
- getch();
+ dump_window(stdscr);
printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg));
init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN);
printw("...and drawing a box which should be followed by lines\n");
- bkgdset(ACS_HLINE | (attr_t) COLOR_PAIR(3));
+ bkgdset(ACS_HLINE | (chtype) COLOR_PAIR(3));
/*
* Characters from vt100 line-drawing should be mapped to line-drawing,
* since A_ALTCHARSET is set in the background, and the character part
@@ -80,50 +82,50 @@ 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();
+ dump_window(stdscr);
bkgdset((chtype) (' ' | COLOR_PAIR(0)));
printw("Default Colors\n");
- getch();
+ dump_window(stdscr);
printw("Resetting colors to pair 1\n");
bkgdset((chtype) (' ' | COLOR_PAIR(1)));
printw("This line should be red/%s\n", color_name(default_bg));
- getch();
+ dump_window(stdscr);
printw("Setting screen to pair 0\n");
bkgd((chtype) (' ' | COLOR_PAIR(0)));
- getch();
+ dump_window(stdscr);
printw("Setting screen to pair 1\n");
bkgd((chtype) (' ' | COLOR_PAIR(1)));
- getch();
+ dump_window(stdscr);
printw("Setting screen to pair 2\n");
bkgd((chtype) (' ' | COLOR_PAIR(2)));
- getch();
+ dump_window(stdscr);
printw("Setting screen to pair 3\n");
bkgd((chtype) (' ' | COLOR_PAIR(3)));
- getch();
+ dump_window(stdscr);
printw("Setting screen to pair 0\n");
bkgd((chtype) (' ' | COLOR_PAIR(0)));
- getch();
+ dump_window(stdscr);
}
static void
@@ -164,7 +166,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
setlocale(LC_ALL, "");
- while ((n = getopt(argc, argv, "ab:df:")) != -1) {
+ while ((n = getopt(argc, argv, "ab:df:l:")) != -1) {
switch (n) {
#if HAVE_ASSUME_DEFAULT_COLORS
case 'a':
@@ -182,6 +184,10 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
case 'f':
default_fg = color_code(optarg);
break;
+ case 'l':
+ if (!open_dump(optarg))
+ usage();
+ break;
default:
usage();
}
@@ -230,6 +236,6 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
getch();
}
endwin();
-
+ close_dump();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/blue.c b/test/blue.c
index 50d48b1..922caab 100644
--- a/test/blue.c
+++ b/test/blue.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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,17 +37,17 @@
*****************************************************************************/
/*
- * Compile this with the command `cc -O blue.c -lcurses -o blue'. For best
- * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is
- * just as good.
- *
- * $Id: blue.c,v 1.35 2013/04/27 19:46:53 tom Exp $
+ * $Id: blue.c,v 1.53 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
#include <time.h>
+#if HAVE_LANGINFO_CODESET
+#include <langinfo.h>
+#endif
+
#define NOCARD (-1)
#define ACE 0
@@ -97,40 +98,38 @@ static chtype ranks[SUIT_LENGTH][2] =
{' ', 'K'}
};
-/* Please note, that this is a bad example.
- Color values should not be or'ed in. This
- only works, because the characters used here
- are plain and have no color attribute themselves. */
-#ifdef COLOR_PAIR
-#define OR_COLORS(value,pair) ((value) | COLOR_PAIR(pair))
-#else
-#define OR_COLORS(value,pair) (value)
-#endif
+static int letters[4] =
+{
+ 'h', /* hearts */
+ 's', /* spades */
+ 'd', /* diamonds */
+ 'c', /* clubs */
+};
-#define PC_COLORS(value,pair) (OR_COLORS(value,pair) | A_ALTCHARSET)
+#if HAVE_LANGINFO_CODESET
-static chtype letters[4] =
+#if HAVE_TIGETSTR
+static int glyphs[] =
{
- OR_COLORS('h', RED_ON_WHITE), /* hearts */
- OR_COLORS('s', BLACK_ON_WHITE), /* spades */
- OR_COLORS('d', RED_ON_WHITE), /* diamonds */
- OR_COLORS('c', BLACK_ON_WHITE), /* clubs */
+ '\003', /* hearts */
+ '\006', /* spades */
+ '\004', /* diamonds */
+ '\005', /* clubs */
};
+#endif
-#if defined(__i386__) && defined(A_ALTCHARSET) && HAVE_TIGETSTR
-static chtype glyphs[] =
+#if USE_WIDEC_SUPPORT
+static int uglyphs[] =
{
- PC_COLORS('\003', RED_ON_WHITE), /* hearts */
- PC_COLORS('\006', BLACK_ON_WHITE), /* spades */
- PC_COLORS('\004', RED_ON_WHITE), /* diamonds */
- PC_COLORS('\005', BLACK_ON_WHITE), /* clubs */
+ 0x2665, /* hearts */
+ 0x2660, /* spades */
+ 0x2666, /* diamonds */
+ 0x2663 /* clubs */
};
-#define USE_CP437 1
-#else
-#define USE_CP437 0
-#endif /* __i386__ */
+#endif
+#endif /* HAVE_LANGINFO_CODESET */
-static chtype *suits = letters; /* this may change to glyphs below */
+static int *suits = letters; /* this may change to glyphs below */
static void
die(int onsig)
@@ -155,14 +154,14 @@ init_vars(void)
static void
shuffle(int size)
{
- int i, j, numswaps, swapnum, temp;
+ int numswaps, swapnum;
numswaps = size * 10; /* an arbitrary figure */
for (swapnum = 0; swapnum < numswaps; swapnum++) {
- i = rand() % size;
- j = rand() % size;
- temp = deck[i];
+ int i = rand() % size;
+ int j = rand() % size;
+ int temp = deck[i];
deck[i] = deck[j];
deck[j] = temp;
}
@@ -171,11 +170,11 @@ shuffle(int size)
static void
deal_cards(void)
{
- int ptr, card = 0, value, csuit, crank, suit, aces[4];
+ int card = 0, value, csuit, crank, suit, aces[4];
memset(aces, 0, sizeof(aces));
for (suit = HEARTS; suit <= CLUBS; suit++) {
- ptr = freeptr[suit];
+ int ptr = freeptr[suit];
grid[ptr++] = NOCARD; /* 1st card space is blank */
while ((ptr % GRID_WIDTH) != 0) {
value = deck[card++];
@@ -198,15 +197,41 @@ deal_cards(void)
static void
printcard(int value)
{
- (void) addch(' ');
- if (value == NOCARD)
+ AddCh(' ');
+ if (value == NOCARD) {
(void) addstr(" ");
- else {
- addch(ranks[value % SUIT_LENGTH][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
- addch(ranks[value % SUIT_LENGTH][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
- addch(suits[value / SUIT_LENGTH]);
+ } else {
+ int which = (value / SUIT_LENGTH);
+ int isuit = (value % SUIT_LENGTH);
+ chtype color = (chtype) COLOR_PAIR(((which % 2) == 0)
+ ? 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));
+
+#ifdef NCURSES_VERSION
+ (attron) ((int) color); /* quieter compiler warnings */
+#else
+ attron(color); /* PDCurses, etc., either no macro or wrong */
+#endif
+#if USE_WIDEC_SUPPORT
+ {
+ wchar_t values[2];
+ values[0] = (wchar_t) suits[which];
+ values[1] = 0;
+ addwstr(values);
+ }
+#else
+ AddCh(suits[which]);
+#endif
+#ifdef NCURSES_VERSION
+ (attroff) ((int) color);
+#else
+ attroff(color);
+#endif
}
- (void) addch(' ');
+ AddCh(' ');
}
static void
@@ -315,16 +340,16 @@ play_game(void)
} else {
char buf[BUFSIZ];
- (void) sprintf(buf,
- "Type [%s] to move, r to redraw, q or INTR to quit: ",
- live);
+ _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+ "Type [%s] to move, r to redraw, q or INTR to quit: ",
+ live);
do {
move(PROMPTROW, 0);
(void) addstr(buf);
move(PROMPTROW, (int) strlen(buf));
clrtoeol();
- (void) addch(' ');
+ AddCh(' ');
} while
(((c = (char) getch()) < 'a' || c > 'd')
&& (c != 'r')
@@ -364,10 +389,10 @@ play_game(void)
static int
collect_discards(void)
{
- int row, col, cardno = 0, finish, gridno;
+ int row, col, cardno = 0, gridno;
for (row = HEARTS; row <= CLUBS; row++) {
- finish = 0;
+ int finish = 0;
for (col = 1; col < GRID_WIDTH; col++) {
gridno = row * GRID_WIDTH + col;
@@ -402,41 +427,58 @@ game_finished(int deal)
refresh();
}
+#if HAVE_LANGINFO_CODESET
+/*
+ * This program first appeared in ncurses in January 1995. At that point, the
+ * Linux console was able to display CP437 graphic characters, e.g., in the
+ * range 0-31. As of 2016, most Linux consoles are running with the UTF-8
+ * (partial) support. Incidentally, that makes all of the cards diamonds.
+ */
+static void
+use_pc_display(void)
+{
+ char *check = nl_langinfo(CODESET);
+ if (!strcmp(check, "UTF-8")) {
+#if USE_WIDEC_SUPPORT
+ suits = uglyphs;
+#endif
+ } else {
+#if HAVE_TIGETSTR
+ if (!strcmp(check, "IBM437") ||
+ !strcmp(check, "CP437") ||
+ !strcmp(check, "IBM850") ||
+ !strcmp(check, "CP850")) {
+ char *smacs = tigetstr("smacs");
+ char *smpch = tigetstr("smpch");
+ /*
+ * The ncurses library makes this check to decide whether to allow
+ * the alternate character set for the (normally) nonprinting codes.
+ */
+ if (smacs != 0 && smpch != 0 && !strcmp(smacs, smpch)) {
+ suits = glyphs;
+ }
+ }
+#endif
+ }
+}
+#else
+#define use_pc_display() /* nothing */
+#endif /* HAVE_LANGINFO_CODESET */
+
int
main(int argc, char *argv[])
{
- CATCHALL(die);
-
setlocale(LC_ALL, "");
- initscr();
+ use_pc_display();
+
+ InitAndCatch(initscr(), die);
- /*
- * We use COLOR_GREEN because COLOR_BLACK is wired to the wrong thing.
- */
start_color();
init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE);
init_pair(BLUE_ON_WHITE, COLOR_BLUE, COLOR_WHITE);
init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE);
-#ifndef COLOR_PAIR
- letters[0] = OR_COLORS('h', RED_ON_WHITE); /* hearts */
- letters[1] = OR_COLORS('s', BLACK_ON_WHITE); /* spades */
- letters[2] = OR_COLORS('d', RED_ON_WHITE); /* diamonds */
- letters[3] = OR_COLORS('c', BLACK_ON_WHITE); /* clubs */
-#if USE_CP437
- glyphs[0] = PC_COLORS('\003', RED_ON_WHITE); /* hearts */
- glyphs[1] = PC_COLORS('\006', BLACK_ON_WHITE); /* spades */
- glyphs[2] = PC_COLORS('\004', RED_ON_WHITE); /* diamonds */
- glyphs[3] = PC_COLORS('\005', BLACK_ON_WHITE); /* clubs */
-#endif
-#endif
-
-#if USE_CP437
- if (tigetstr("smpch"))
- suits = glyphs;
-#endif /* USE_CP437 */
-
cbreak();
if (argc == 2)
diff --git a/test/bs.6 b/test/bs.6
index 657f538..364fc8f 100644
--- a/test/bs.6
+++ b/test/bs.6
@@ -1,5 +1,6 @@
.\"***************************************************************************
-.\" Copyright (c) 1998,2006 Free Software Foundation, Inc. *
+.\" Copyright 2020 Thomas E. Dickey *
+.\" Copyright 1998,2006 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 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: bs.6,v 1.2 2006/04/22 22:42:44 tom Exp $
+.\" $Id: bs.6,v 1.3 2020/02/02 23:34:34 tom Exp $
.TH BATTLESHIPS 6 "Aug 23, 1989"
.SH NAME
bs \- battleships game
diff --git a/test/bs.c b/test/bs.c
index a74f643..0e4076f 100644
--- a/test/bs.c
+++ b/test/bs.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -34,7 +35,7 @@
* v2.0 featuring strict ANSI/POSIX conformance, November 1993.
* v2.1 with ncurses mouse support, September 1995
*
- * $Id: bs.c,v 1.63 2014/08/09 22:27:12 tom Exp $
+ * $Id: bs.c,v 1.75 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -64,6 +65,8 @@ static int getcoord(int);
#define CTRLC '\003' /* used as terminate command */
#define FF '\014' /* used as redraw command */
+#define is_QUIT(c) ((c) == CTRLC || (c) == QUIT)
+
/* coordinate handling */
#define BWIDTH 10
#define BDEPTH 10
@@ -114,17 +117,20 @@ static char *your_name;
static char dftname[] = "stranger";
/* direction constants */
-#define E 0
-#define SE 1
-#define S 2
-#define SW 3
-#define W 4
-#define NW 5
-#define N 6
-#define NE 7
-static int xincr[8] =
+typedef enum {
+ dir_E = 0
+ ,dir_SE
+ ,dir_S
+ ,dir_SW
+ ,dir_W
+ ,dir_NW
+ ,dir_N
+ ,dir_NE
+ ,dir_MAX
+} DIRECTIONS;
+static int xincr[dir_MAX + 2] =
{1, 1, 0, -1, -1, -1, 0, 1};
-static int yincr[8] =
+static int yincr[dir_MAX + 2] =
{0, 1, 1, 1, 0, -1, -1, -1};
/* current ship position and direction */
@@ -145,6 +151,7 @@ static bool checkplace(int b, ship_t * ss, int vis);
#define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE }
+/* "ply=player", "cpu=computer" */
static ship_t plyship[SHIPTYPES] =
{
SHIPIT(carrier, 'A', 5),
@@ -185,6 +192,7 @@ uninitgame(int sig GCC_UNUSED)
(void) reset_shell_mode();
(void) echo();
(void) endwin();
+ free(your_name);
ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS);
}
@@ -214,20 +222,19 @@ announceopts(void)
static void
intro(void)
{
- char *tmpname;
+ const char *tmpname;
srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */
- CATCHALL(uninitgame);
+ InitAndCatch(initscr(), uninitgame);
if ((tmpname = getlogin()) != 0 &&
(your_name = strdup(tmpname)) != 0) {
your_name[0] = (char) toupper(UChar(your_name[0]));
} else {
- your_name = dftname;
+ your_name = strdup(dftname);
}
- (void) initscr();
keypad(stdscr, TRUE);
(void) def_prog_mode();
(void) nonl();
@@ -306,7 +313,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;
@@ -324,9 +331,9 @@ randomplace(int b, ship_t * ss)
{
do {
- ss->dir = rnd(2) ? E : S;
- ss->x = rnd(BWIDTH - (ss->dir == E ? ss->length : 0));
- ss->y = rnd(BDEPTH - (ss->dir == S ? ss->length : 0));
+ ss->dir = rnd(2) ? dir_E : dir_S;
+ ss->x = rnd(BWIDTH - (ss->dir == dir_E ? ss->length : 0));
+ ss->y = rnd(BDEPTH - (ss->dir == dir_S ? ss->length : 0));
} while
(!checkplace(b, ss, FALSE));
}
@@ -371,14 +378,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");
@@ -389,14 +396,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);
@@ -461,9 +468,11 @@ initgame(void)
do {
c = (char) getch();
} while
- (!(strchr("hjkl8462rR", c) || c == FF));
+ (!(strchr("hjkl8462rR", c) || c == FF || is_QUIT(c)));
- if (c == FF) {
+ if (is_QUIT(c)) {
+ uninitgame(0);
+ } else if (c == FF) {
(void) clearok(stdscr, TRUE);
(void) refresh();
} else if (ss == 0) {
@@ -490,19 +499,19 @@ initgame(void)
switch (c) {
case 'k':
case '8':
- ss->dir = N;
+ ss->dir = dir_N;
break;
case 'j':
case '2':
- ss->dir = S;
+ ss->dir = dir_S;
break;
case 'h':
case '4':
- ss->dir = W;
+ ss->dir = dir_W;
break;
case 'l':
case '6':
- ss->dir = E;
+ ss->dir = dir_E;
break;
}
@@ -540,14 +549,15 @@ initgame(void)
static int
getcoord(int atcpu)
{
- int ny, nx, c;
-
if (atcpu)
cgoto(cury, curx);
else
pgoto(cury, curx);
(void) refresh();
+
for (;;) {
+ int ny, nx, c;
+
if (atcpu) {
MvPrintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)",
curx, 'A' + cury);
@@ -660,7 +670,7 @@ collidecheck(int b, int y, int x)
if (!closepack) {
int i;
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < dir_MAX; i++) {
int xend, yend;
yend = y + yincr[i];
@@ -723,10 +733,9 @@ static int
awinna(void)
{
int i, j;
- ship_t *ss;
for (i = 0; i < 2; ++i) {
- ss = (i) ? cpuship : plyship;
+ ship_t *ss = (i) ? cpuship : plyship;
for (j = 0; j < SHIPTYPES; ++j, ++ss)
if (ss->length > ss->hits)
break;
@@ -753,12 +762,14 @@ hitship(int x, int y)
if (++ss->hits < ss->length) /* still afloat? */
return ((ship_t *) NULL);
else { /* sunk! */
- int i, j;
+ int i;
+
+ if (!closepack) {
+ int j;
- if (!closepack)
for (j = -1; j <= 1; j++) {
- int bx = ss->x + j * xincr[(ss->dir + 2) % 8];
- int by = ss->y + j * yincr[(ss->dir + 2) % 8];
+ int bx = ss->x + j * xincr[(ss->dir + 2) % dir_MAX];
+ int by = ss->y + j * yincr[(ss->dir + 2) % dir_MAX];
for (i = -1; i <= ss->length; ++i) {
int x1, y1;
@@ -773,17 +784,18 @@ 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);
}
}
}
}
+ }
for (i = 0; i < ss->length; ++i) {
int x1 = ss->x + i * xincr[ss->dir];
@@ -792,14 +804,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 */
@@ -841,7 +853,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 */
@@ -876,20 +888,20 @@ plyturn(void)
static int
sgetc(const char *s)
{
- const char *s1;
- int ch;
-
(void) refresh();
+
for (;;) {
- ch = getch();
+ int ch = getch();
+ const char *s1;
+
if (islower(ch))
ch = toupper(ch);
- if (ch == CTRLC)
+ if (is_QUIT(ch))
uninitgame(0);
for (s1 = s; *s1 && ch != *s1; ++s1)
continue;
if (*s1) {
- (void) addch((chtype) ch);
+ AddCh(ch);
(void) refresh();
return (ch);
}
@@ -974,7 +986,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 */
@@ -1002,7 +1014,7 @@ cputurn(void)
#define REVERSE_JUMP 4
#define SECOND_PASS 5
static int next = RANDOM_FIRE;
- static bool used[4];
+ static bool used[5];
static ship_t ts;
int navail, x, y, d, n;
int hit = S_MISS;
@@ -1022,11 +1034,14 @@ cputurn(void)
break;
case RANDOM_HIT: /* last shot was random and hit */
- used[E / 2] = used[S / 2] = used[W / 2] = used[N / 2] = FALSE;
+ used[dir_E / 2] =
+ used[dir_S / 2] =
+ used[dir_W / 2] =
+ used[dir_N / 2] = FALSE;
/* FALLTHROUGH */
case HUNT_DIRECT: /* last shot hit, we're looking for ship's long axis */
- for (d = navail = 0; d < 4; d++) {
+ for (d = navail = 0; d < (dir_MAX) / 2; d++) {
x = ts.x + xincr[d * 2];
y = ts.y + yincr[d * 2];
if (!used[d] && POSSIBLE(x, y))
@@ -1038,13 +1053,13 @@ cputurn(void)
goto refire; /* ...so we must random-fire */
else {
n = rnd(navail) + 1;
- for (d = 0; used[d]; d++) ;
+ for (d = 0; d < (dir_MAX) / 2 && used[d]; d++) ;
/* used[d] is first that == 0 */
for (; n > 1; n--)
- while (used[++d]) ;
+ while (d < (dir_MAX) / 2 && used[++d]) ;
/* used[d] is next that == 0 */
- assert(d < 4);
+ assert(d < (dir_MAX) / 2);
assert(used[d] == FALSE);
used[d] = TRUE;
@@ -1078,7 +1093,7 @@ cputurn(void)
break;
case REVERSE_JUMP: /* nail down the ship's other end */
- d = (ts.dir + 4) % 8;
+ d = (ts.dir + (dir_MAX) / 2) % dir_MAX;
x = ts.x + ts.hits * xincr[d];
y = ts.y + ts.hits * yincr[d];
if (POSSIBLE(x, y) && (hit = cpufire(x, y))) {
@@ -1127,7 +1142,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())
@@ -1150,14 +1165,14 @@ playagain(void)
static void
do_options(int c, char *op[])
{
- register int i;
-
if (c > 1) {
+ int i;
+
for (i = 1; i < c; i++) {
switch (op[i][0]) {
default:
case '?':
- (void) fprintf(stderr, "Usage: battle [-s | -b] [-c]\n");
+ (void) fprintf(stderr, "Usage: bs [-s | -b] [-c]\n");
(void) fprintf(stderr, "\tWhere the options are:\n");
(void) fprintf(stderr, "\t-s : play a salvo game\n");
(void) fprintf(stderr, "\t-b : play a blitz game\n");
diff --git a/test/bulgarian-utf8-tabs.txt b/test/bulgarian-utf8-tabs.txt
new file mode 100644
index 0000000..65e42bb
--- /dev/null
+++ b/test/bulgarian-utf8-tabs.txt
@@ -0,0 +1,6 @@
+Показване на помощна информация -- 1
+Създаване на дялове -- 2
+Избор на дял и форматиране -- 3
+Записване в избрания дял -- 4
+Инсталиране на LILO -- 5
+Изход от програмата -- 6
diff --git a/test/cardfile.c b/test/cardfile.c
index b750241..bf03755 100644
--- a/test/cardfile.c
+++ b/test/cardfile.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1999-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: cardfile.c,v 1.42 2013/09/28 22:02:17 tom Exp $
+ * $Id: cardfile.c,v 1.47 2020/02/02 23:34:34 tom Exp $
*
* File format: text beginning in column 1 is a title; other text is content.
*/
@@ -125,15 +126,19 @@ add_title(const char *title)
static void
add_content(CARD * card, const char *content)
{
- size_t total, offset;
+ size_t total;
content = skip(content);
if ((total = strlen(content)) != 0) {
+ size_t offset;
+
if (card->content != 0 && (offset = strlen(card->content)) != 0) {
total += 1 + offset;
card->content = typeRealloc(char, total + 1, card->content);
- if (card->content)
- strcpy(card->content + offset++, " ");
+ if (card->content) {
+ _nc_STRCPY(card->content + offset, " ", total + 1 - offset);
+ offset++;
+ }
} else {
offset = 0;
if (card->content != 0)
@@ -141,7 +146,7 @@ add_content(CARD * card, const char *content)
card->content = typeMalloc(char, total + 1);
}
if (card->content)
- strcpy(card->content + offset, content);
+ _nc_STRCPY(card->content + offset, content, total + 1 - offset);
else
failed("add_content");
}
@@ -171,10 +176,11 @@ static void
read_data(char *fname)
{
FILE *fp;
- CARD *card = 0;
- char buffer[BUFSIZ];
if ((fp = fopen(fname, "r")) != 0) {
+ CARD *card = 0;
+ char buffer[BUFSIZ];
+
while (fgets(buffer, sizeof(buffer), fp)) {
trim(buffer);
if (isspace(UChar(*buffer))) {
@@ -195,15 +201,17 @@ static void
write_data(const char *fname)
{
FILE *fp;
- CARD *p = 0;
- int n;
if (!strcmp(fname, default_name))
fname = "cardfile.out";
if ((fp = fopen(fname, "w")) != 0) {
+ CARD *p = 0;
+
for (p = all_cards; p != 0; p = p->link) {
FIELD **f = form_fields(p->form);
+ int n;
+
for (n = 0; f[n] != 0; n++) {
char *s = field_buffer(f[n], 0);
if (s != 0
@@ -363,7 +371,7 @@ show_legend(void)
#if (defined(KEY_RESIZE) && HAVE_WRESIZE) || NO_LEAKS
static void
-free_form_fields(FIELD ** f)
+free_form_fields(FIELD **f)
{
int n;
@@ -389,7 +397,6 @@ cardfile(char *fname)
int form_high;
int y;
int x;
- int ch = ERR;
int finished = FALSE;
show_legend();
@@ -430,6 +437,8 @@ cardfile(char *fname)
order_cards(top_card, visible_cards);
while (!finished) {
+ int ch = ERR;
+
update_panels();
doupdate();
@@ -520,13 +529,11 @@ cardfile(char *fname)
}
#if NO_LEAKS
while (all_cards != 0) {
- FIELD **f;
-
p = all_cards;
all_cards = all_cards->link;
if (isVisible(p)) {
- f = form_fields(p->form);
+ FIELD **f = form_fields(p->form);
unpost_form(p->form); /* ...so we can free it */
free_form(p->form); /* this also disconnects the fields */
@@ -547,7 +554,7 @@ usage(void)
{
static const char *msg[] =
{
- "Usage: view [options] file"
+ "Usage: cardfile [options] file"
,""
,"Options:"
," -c use color if terminal supports it"
diff --git a/test/chgat.c b/test/chgat.c
index 919b5c9..a5bcbea 100644
--- a/test/chgat.c
+++ b/test/chgat.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2006-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2006-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,12 +27,13 @@
* authorization. *
****************************************************************************/
/*
- * $Id: chgat.c,v 1.12 2012/11/18 01:55:35 tom Exp $
+ * $Id: chgat.c,v 1.19 2020/02/02 23:34:34 tom Exp $
*
* test-driver for chgat/wchgat/mvchgat/mvwchgat
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if HAVE_CHGAT
@@ -45,10 +47,10 @@
#endif
typedef struct {
- unsigned c;
- unsigned v;
+ size_t c;
+ size_t v;
short pair;
- unsigned attr;
+ attr_t attr;
int count;
int ch;
const char *c_msg;
@@ -60,7 +62,7 @@ typedef struct {
} STATUS;
static const char *
-color_params(unsigned state, short *pair)
+color_params(size_t state, short *pair)
{
/* *INDENT-OFF* */
static struct {
@@ -74,12 +76,13 @@ color_params(unsigned state, short *pair)
};
/* *INDENT-ON* */
- static bool first = TRUE;
const char *result = 0;
if (has_colors()) {
+ static bool first = TRUE;
+
if (first) {
- unsigned n;
+ size_t n;
start_color();
for (n = 0; n < SIZEOF(table); ++n) {
@@ -95,18 +98,18 @@ color_params(unsigned state, short *pair)
}
static const char *
-video_params(unsigned state, unsigned *attr)
+video_params(size_t state, attr_t *attr)
{
/* *INDENT-OFF* */
static struct {
- unsigned attr;
+ attr_t attr;
const char *msg;
} table[] = {
- { A_NORMAL, "normal" },
- { A_BOLD, "bold" },
- { A_REVERSE, "reverse" },
- { A_UNDERLINE, "underline" },
- { A_BLINK, "blink" },
+ { WA_NORMAL, "normal" },
+ { WA_BOLD, "bold" },
+ { WA_REVERSE, "reverse" },
+ { WA_UNDERLINE, "underline" },
+ { WA_BLINK, "blink" },
};
/* *INDENT-ON* */
@@ -200,7 +203,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 +217,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 +274,8 @@ update_status(WINDOW *win, STATUS * sp)
sp->count = -(sp->count);
show_status(win, sp);
break;
- case '?':
- do_subwindow(win, sp, show_help);
+ case HELP_KEY_1:
+ show_help(win);
break;
default:
if (isdigit(sp->ch)) {
diff --git a/test/clip_printw.c b/test/clip_printw.c
index d40bf01..f068457 100644
--- a/test/clip_printw.c
+++ b/test/clip_printw.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,12 +27,13 @@
* authorization. *
****************************************************************************/
/*
- * $Id: clip_printw.c,v 1.10 2014/08/02 23:13:29 tom Exp $
+ * $Id: clip_printw.c,v 1.17 2020/02/02 23:34:34 tom Exp $
*
* demonstrate how to use printw without wrapping.
*/
#include <test.priv.h>
+#include <popup_msg.h>
#ifdef HAVE_VW_PRINTW
@@ -55,7 +57,7 @@ typedef struct {
} STATUS;
static int
-clip_wprintw(WINDOW *win, NCURSES_CONST char *fmt,...)
+clip_wprintw(WINDOW *win, NCURSES_CONST char *fmt, ...)
{
int y0, x0, y1, x1, width;
WINDOW *sub;
@@ -102,10 +104,11 @@ color_params(unsigned state, int *pair)
};
/* *INDENT-ON* */
- static bool first = TRUE;
const char *result = 0;
if (has_colors()) {
+ static bool first = TRUE;
+
if (first) {
unsigned n;
@@ -132,11 +135,11 @@ video_params(unsigned state, attr_t *attr)
attr_t attr;
const char *msg;
} table[] = {
- { A_NORMAL, "normal" },
- { A_BOLD, "bold" },
- { A_REVERSE, "reverse" },
- { A_UNDERLINE, "underline" },
- { A_BLINK, "blink" },
+ { WA_NORMAL, "normal" },
+ { WA_BOLD, "bold" },
+ { WA_REVERSE, "reverse" },
+ { WA_UNDERLINE, "underline" },
+ { WA_BLINK, "blink" },
};
/* *INDENT-ON* */
@@ -231,7 +234,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 +243,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 +299,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)) {
@@ -334,10 +329,10 @@ test_clipping(WINDOW *win)
(void) wattrset(win, AttrArg(COLOR_PAIR(st.pair), st.attr));
if (st.count > 0) {
need = (unsigned) st.count + 1;
- sprintf(fmt, "%%c%%%ds%%c", st.count);
+ _nc_SPRINTF(fmt, _nc_SLIMIT(sizeof(fmt)) "%%c%%%ds%%c", st.count);
} else {
need = (unsigned) getmaxx(win) - 1;
- strcpy(fmt, "%c%s%c");
+ _nc_STRCPY(fmt, "%c%s%c", sizeof(fmt));
}
if ((buffer = typeMalloc(char, need + 1)) != 0) {
for (j = 0; j < need; ++j) {
diff --git a/test/color_content.c b/test/color_content.c
new file mode 100644
index 0000000..0f619f6
--- /dev/null
+++ b/test/color_content.c
@@ -0,0 +1,331 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: color_content.c,v 1.12 2020/02/02 23:34:34 tom Exp $
+ */
+
+#define NEED_TIME_H
+#include <test.priv.h>
+
+#if USE_EXTENDED_COLOR
+typedef int my_color_t;
+#else
+typedef NCURSES_COLOR_T my_color_t;
+#endif
+
+typedef struct {
+ my_color_t r;
+ my_color_t g;
+ my_color_t b;
+} MYCOLOR;
+
+static int f_opt;
+static int i_opt;
+static int l_opt;
+static int n_opt;
+static int p_opt;
+static int r_opt;
+static int s_opt;
+
+#if USE_EXTENDED_COLOR
+static int x_opt;
+#endif
+
+static MYCOLOR *expected;
+
+#if HAVE_GETTIMEOFDAY
+static struct timeval initial_time;
+static struct timeval finish_time;
+#endif
+
+static void
+failed(const char *msg)
+{
+ printw("%s", msg);
+ getch();
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+#if USE_EXTENDED_COLOR
+static int
+InitColor(int pair, int r, int g, int b)
+{
+ int rc;
+ if (x_opt) {
+ rc = init_extended_color(pair, r, g, b);
+ } else {
+ rc = init_color((NCURSES_PAIRS_T) pair,
+ (NCURSES_COLOR_T) r,
+ (NCURSES_COLOR_T) g,
+ (NCURSES_COLOR_T) b);
+ }
+ return rc;
+}
+
+static int
+ColorContent(int color, int *rp, int *gp, int *bp)
+{
+ int rc;
+ if (x_opt) {
+ rc = extended_color_content(color, rp, gp, bp);
+ } else {
+ NCURSES_COLOR_T r, g, b;
+ if ((rc = color_content((NCURSES_COLOR_T) color, &r, &g, &b)) == OK) {
+ *rp = r;
+ *gp = g;
+ *bp = b;
+ }
+ }
+ return rc;
+}
+#else
+#define InitColor(color,r,g,b) init_color((NCURSES_COLOR_T)color,(NCURSES_COLOR_T)r,(NCURSES_COLOR_T)g,(NCURSES_COLOR_T)b)
+#define ColorContent(color,rp,gp,bp) color_content((NCURSES_COLOR_T)color,rp,gp,bp)
+#endif
+
+static my_color_t
+random_color(void)
+{
+ return (my_color_t) (rand() % 1000);
+}
+
+static void
+setup_test(void)
+{
+ initscr();
+ cbreak();
+ noecho();
+ scrollok(stdscr, TRUE);
+ if (has_colors()) {
+ start_color();
+ if (!can_change_color() && !p_opt)
+ failed("this terminal cannot initialize colors");
+
+ if (!f_opt)
+ f_opt = 0;
+ if (!l_opt)
+ l_opt = COLORS;
+ if (l_opt <= 0)
+ failed("color limit must be greater than zero");
+
+ if (!n_opt) {
+ int color;
+ size_t need = (size_t) ((l_opt > COLORS) ? l_opt : COLORS) + 1;
+
+ expected = typeCalloc(MYCOLOR, need);
+ if (s_opt) {
+ int r;
+ int g;
+ int b;
+ color = f_opt;
+ for (r = 0; r < 1000; ++r) {
+ for (g = 0; g < 1000; ++g) {
+ for (b = 0; b < 1000; ++b) {
+ if (color < l_opt) {
+ InitColor(color, r, g, b);
+ expected[color].r = (my_color_t) r;
+ expected[color].g = (my_color_t) g;
+ expected[color].b = (my_color_t) b;
+ ++color;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ for (color = f_opt; color < l_opt; ++color) {
+ expected[color].r = random_color();
+ expected[color].g = random_color();
+ expected[color].b = random_color();
+ InitColor(color,
+ expected[color].r,
+ expected[color].g,
+ expected[color].b);
+ }
+ }
+ }
+ } else {
+ failed("This demo requires a color terminal");
+ }
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&initial_time, 0);
+#endif
+}
+
+static void
+run_test(void)
+{
+ int color;
+ bool success = TRUE;
+ for (color = f_opt; color < l_opt; ++color) {
+ my_color_t r;
+ my_color_t g;
+ my_color_t b;
+ if (ColorContent(color, &r, &g, &b) == OK) {
+ if (expected != 0) {
+ if (r != expected[color].r)
+ success = FALSE;
+ if (g != expected[color].g)
+ success = FALSE;
+ if (b != expected[color].b)
+ success = FALSE;
+ }
+ }
+ }
+ if (i_opt) {
+ addch(success ? '.' : '?');
+ refresh();
+ }
+}
+
+static void
+finish_test(void)
+{
+ getch();
+ endwin();
+}
+
+#if HAVE_GETTIMEOFDAY
+static double
+seconds(struct timeval *mark)
+{
+ double result = (double) mark->tv_sec;
+ result += ((double) mark->tv_usec / 1e6);
+ return result;
+}
+#endif
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: color_content [options]"
+ ,""
+ ,"Options:"
+ ," -f COLOR first color value to test (default: 0)"
+ ," -i interactive, showing test-progress"
+ ," -l COLOR last color value to test (default: max_colors-1)"
+ ," -n do not initialize color pairs"
+ ," -p print data for color content instead of testing"
+ ," -r COUNT repeat for given count"
+ ," -s initialize pairs sequentially rather than random"
+#if USE_EXTENDED_COLOR
+ ," -x use extended color pairs/values"
+#endif
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int i;
+
+ while ((i = getopt(argc, argv, "f:il:npr:sx")) != -1) {
+ switch (i) {
+ case 'f':
+ if ((f_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'i':
+ i_opt = 1;
+ break;
+ case 'l':
+ if ((l_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'n':
+ n_opt = 1;
+ break;
+ case 'p':
+ p_opt = 1;
+ break;
+ case 'r':
+ if ((r_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 's':
+ s_opt = 1;
+ break;
+#if USE_EXTENDED_COLOR
+ case 'x':
+ x_opt = 1;
+ break;
+#endif
+ default:
+ usage();
+ }
+ }
+ if (optind < argc)
+ usage();
+ if (r_opt <= 0)
+ r_opt = 1;
+
+ setup_test();
+ if (p_opt) {
+ endwin();
+ for (i = 0; i < COLORS; ++i) {
+ my_color_t r, g, b;
+ if (ColorContent(i, &r, &g, &b) == OK) {
+ printf("%d: %d %d %d\n", i, r, g, b);
+ } else {
+ printf("%d: ? ?\n", i);
+ }
+ }
+ } else {
+ int repeat;
+
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ run_test();
+ if (i_opt) {
+ addch('.');
+ refresh();
+ }
+ }
+
+ if (i_opt) {
+ addch('\n');
+ }
+ printw("DONE: ");
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&finish_time, 0);
+ printw("%.03f seconds",
+ seconds(&finish_time)
+ - seconds(&initial_time));
+#endif
+ finish_test();
+ }
+
+ ExitProgram(EXIT_SUCCESS);
+}
diff --git a/test/color_name.h b/test/color_name.h
index 81a3b31..0dadd2a 100644
--- a/test/color_name.h
+++ b/test/color_name.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2011,2012 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2011-2012,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 *
@@ -26,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: color_name.h,v 1.4 2012/11/18 01:59:32 tom Exp $
+ * $Id: color_name.h,v 1.7 2020/02/02 23:34:34 tom Exp $
*/
#ifndef __COLORNAME_H
@@ -79,7 +80,7 @@ color_code(const char *color)
}
return result;
}
-#endif /* NEED_COLOR_NAME */
+#endif /* NEED_COLOR_CODE */
#ifdef NEED_COLOR_NAME
static const char *
@@ -89,7 +90,7 @@ color_name(int color)
const char *result = 0;
if (color >= (int) SIZEOF(the_color_names)) {
- sprintf(temp, "%d", color);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(result)) "%d", color);
result = temp;
} else if (color < 0) {
result = "default";
diff --git a/test/color_set.c b/test/color_set.c
index 477d049..016b993 100644
--- a/test/color_set.c
+++ b/test/color_set.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2003-2012,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 *
@@ -26,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: color_set.c,v 1.8 2014/02/01 22:10:42 tom Exp $
+ * $Id: color_set.c,v 1.10 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -39,13 +40,14 @@ int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
NCURSES_COLOR_T f, b;
- int i;
initscr();
cbreak();
noecho();
if (has_colors()) {
+ int i;
+
start_color();
(void) pair_content(0, &f, &b);
diff --git a/test/configure b/test/configure
index 51dd2d0..4d59647 100755
--- a/test/configure
+++ b/test/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20141204.
+# Generated by Autoconf 2.52.20200111.
#
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
@@ -139,6 +139,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
@@ -281,6 +282,15 @@ do
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir=$ac_optarg ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst \
+ | --runs | --run | --ru)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* \
+ | --runs=* | --run=* | --ru=*)
+ runstatedir=$ac_optarg ;;
+
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
@@ -618,6 +628,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR extra definition of runtime data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -646,21 +657,24 @@ if test -n "$ac_init_help"; then
cat <<\EOF
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
-
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+
General Options:
+ --disable-stripping do not strip (debug info) installed executables
+ --enable-string-hacks work around bogus compiler/loader warnings
--with-pkg-config{=path} enable/disable use of pkg-config
--disable-echo do not display "compiling" commands
Curses Version-dependent Options:
--with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
--disable-widec disable checks for wide-character functions
--with-curses-dir=DIR directory in which (n)curses is installed
+ --with-screen=XXX use specified curses-libraries
--with-ncursesw use wide ncurses-libraries
--with-ncurses use ncurses-libraries
--with-pdcurses compile/link with pdcurses X11 library
@@ -671,6 +685,10 @@ Curses Version-dependent Options:
--with-neXtaw link with neXT Athena library
--with-XawPlus link with Athena-Plus library
--with-x use the X Window System
+ --with-x11-rgb=FILE file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
+ --disable-panel disable checks for panel functions
+ --disable-menu disable checks for menu functions
+ --disable-form disable checks for form functions
Testing/development Options:
--enable-warnings test: turn on gcc compiler warnings
--with-dmalloc test: use Gray Watson's dmalloc library
@@ -747,7 +765,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.52.20141204. Invocation command line was
+generated by GNU Autoconf 2.52.20200111. Invocation command line was
$ $0 $@
@@ -871,7 +889,7 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- { echo "$as_me:874: loading site script $ac_site_file" >&5
+ { echo "$as_me:892: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
cat "$ac_site_file" >&5
. "$ac_site_file"
@@ -882,7 +900,7 @@ if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special
# files actually), so we avoid doing that.
if test -f "$cache_file"; then
- { echo "$as_me:885: loading cache $cache_file" >&5
+ { echo "$as_me:903: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -890,7 +908,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
esac
fi
else
- { echo "$as_me:893: creating cache $cache_file" >&5
+ { echo "$as_me:911: creating cache $cache_file" >&5
echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -906,21 +924,21 @@ for ac_var in `(set) 2>&1 |
eval ac_new_val="\$ac_env_${ac_var}_value"
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:909: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+ { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:913: error: \`$ac_var' was not set in the previous run" >&5
+ { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:919: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:921: former value: $ac_old_val" >&5
+ { echo "$as_me:939: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:923: current value: $ac_new_val" >&5
+ { echo "$as_me:941: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
ac_cache_corrupted=:
fi;;
@@ -939,9 +957,9 @@ echo "$as_me: current value: $ac_new_val" >&2;}
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:942: error: changes in the environment can compromise the build" >&5
+ { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:944: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+ { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -962,10 +980,10 @@ esac
echo "#! $SHELL" >conftest.sh
echo "exit 0" >>conftest.sh
chmod +x conftest.sh
-if { (echo "$as_me:965: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
(PATH=".;."; conftest.sh) 2>&5
ac_status=$?
- echo "$as_me:968: \$? = $ac_status" >&5
+ echo "$as_me:986: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_path_separator=';'
else
@@ -997,7 +1015,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:1000: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+ { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1007,11 +1025,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:1010: error: cannot run $ac_config_sub" >&5
+ { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
{ (exit 1); exit 1; }; }
-echo "$as_me:1014: checking build system type" >&5
+echo "$as_me:1032: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6
if test "${ac_cv_build+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1020,16 +1038,16 @@ else
test -z "$ac_cv_build_alias" &&
ac_cv_build_alias=`$ac_config_guess`
test -z "$ac_cv_build_alias" &&
- { { echo "$as_me:1023: error: cannot guess build type; you must specify one" >&5
+ { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
{ (exit 1); exit 1; }; }
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
- { { echo "$as_me:1027: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+ { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:1032: result: $ac_cv_build" >&5
+echo "$as_me:1050: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1037,7 +1055,7 @@ build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
- echo "$as_me:1040: checking host system type" >&5
+ echo "$as_me:1058: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1046,12 +1064,12 @@ else
test -z "$ac_cv_host_alias" &&
ac_cv_host_alias=$ac_cv_build_alias
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
- { { echo "$as_me:1049: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+ { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:1054: result: $ac_cv_host" >&5
+echo "$as_me:1072: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1077,13 +1095,13 @@ else
fi
test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1080: result: Configuring for $cf_cv_system_name" >&5
+test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
if test ".$system_name" != ".$cf_cv_system_name" ; then
- echo "$as_me:1084: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+ echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
- { { echo "$as_me:1086: error: \"Please remove config.cache and try again.\"" >&5
+ { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -1101,7 +1119,7 @@ _ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed
-echo "$as_me:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
@@ -1121,11 +1139,11 @@ fi
rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:1124: result: yes" >&5
+ echo "$as_me:1142: result: yes" >&5
echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$as_me:1128: result: no" >&5
+ echo "$as_me:1146: result: no" >&5
echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -1139,7 +1157,7 @@ ac_main_return=return
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1142: checking for $ac_word" >&5
+echo "$as_me:1160: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1154,7 +1172,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1157: found $ac_dir/$ac_word" >&5
+echo "$as_me:1175: found $ac_dir/$ac_word" >&5
break
done
@@ -1162,10 +1180,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1165: result: $CC" >&5
+ echo "$as_me:1183: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1168: result: no" >&5
+ echo "$as_me:1186: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1174,7 +1192,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:1177: checking for $ac_word" >&5
+echo "$as_me:1195: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1189,7 +1207,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1192: found $ac_dir/$ac_word" >&5
+echo "$as_me:1210: found $ac_dir/$ac_word" >&5
break
done
@@ -1197,10 +1215,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1200: result: $ac_ct_CC" >&5
+ echo "$as_me:1218: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1203: result: no" >&5
+ echo "$as_me:1221: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1213,7 +1231,7 @@ if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1216: checking for $ac_word" >&5
+echo "$as_me:1234: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1228,7 +1246,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1231: found $ac_dir/$ac_word" >&5
+echo "$as_me:1249: found $ac_dir/$ac_word" >&5
break
done
@@ -1236,10 +1254,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1239: result: $CC" >&5
+ echo "$as_me:1257: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1242: result: no" >&5
+ echo "$as_me:1260: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1248,7 +1266,7 @@ if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:1251: checking for $ac_word" >&5
+echo "$as_me:1269: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1263,7 +1281,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1266: found $ac_dir/$ac_word" >&5
+echo "$as_me:1284: found $ac_dir/$ac_word" >&5
break
done
@@ -1271,10 +1289,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1274: result: $ac_ct_CC" >&5
+ echo "$as_me:1292: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1277: result: no" >&5
+ echo "$as_me:1295: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1287,7 +1305,7 @@ fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:1290: checking for $ac_word" >&5
+echo "$as_me:1308: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1307,7 +1325,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
continue
fi
ac_cv_prog_CC="cc"
-echo "$as_me:1310: found $ac_dir/$ac_word" >&5
+echo "$as_me:1328: found $ac_dir/$ac_word" >&5
break
done
@@ -1329,10 +1347,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1332: result: $CC" >&5
+ echo "$as_me:1350: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1335: result: no" >&5
+ echo "$as_me:1353: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1343,7 +1361,7 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1346: checking for $ac_word" >&5
+echo "$as_me:1364: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1358,7 +1376,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1361: found $ac_dir/$ac_word" >&5
+echo "$as_me:1379: found $ac_dir/$ac_word" >&5
break
done
@@ -1366,10 +1384,10 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:1369: result: $CC" >&5
+ echo "$as_me:1387: result: $CC" >&5
echo "${ECHO_T}$CC" >&6
else
- echo "$as_me:1372: result: no" >&5
+ echo "$as_me:1390: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1382,7 +1400,7 @@ if test -z "$CC"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:1385: checking for $ac_word" >&5
+echo "$as_me:1403: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1397,7 +1415,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1400: found $ac_dir/$ac_word" >&5
+echo "$as_me:1418: found $ac_dir/$ac_word" >&5
break
done
@@ -1405,10 +1423,10 @@ fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:1408: result: $ac_ct_CC" >&5
+ echo "$as_me:1426: result: $ac_ct_CC" >&5
echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "$as_me:1411: result: no" >&5
+ echo "$as_me:1429: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -1420,36 +1438,36 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:1423: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:1428:" \
+echo "$as_me:1446:" \
"checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1431: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
(eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1434: \$? = $ac_status" >&5
+ echo "$as_me:1452: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1436: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
(eval $ac_compiler -v </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1439: \$? = $ac_status" >&5
+ echo "$as_me:1457: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:1441: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
(eval $ac_compiler -V </dev/null >&5) 2>&5
ac_status=$?
- echo "$as_me:1444: \$? = $ac_status" >&5
+ echo "$as_me:1462: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line 1448 "configure"
+#line 1466 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -1461,13 +1479,13 @@ ac_clean_files="$ac_clean_files a.out a.exe"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:1464: checking for C compiler default output" >&5
+echo "$as_me:1482: checking for C compiler default output" >&5
echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1467: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
ac_status=$?
- echo "$as_me:1470: \$? = $ac_status" >&5
+ echo "$as_me:1488: \$? = $ac_status" >&5
(exit $ac_status); }; then
# Find the output, starting from the most likely. This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1490,34 +1508,34 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1493: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1511: error: C compiler cannot create executables" >&5
echo "$as_me: error: C compiler cannot create executables" >&2;}
{ (exit 77); exit 77; }; }
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:1499: result: $ac_file" >&5
+echo "$as_me:1517: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1504: checking whether the C compiler works" >&5
+echo "$as_me:1522: checking whether the C compiler works" >&5
echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:1510: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1528: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1513: \$? = $ac_status" >&5
+ echo "$as_me:1531: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:1520: error: cannot run C compiled programs.
+ { { echo "$as_me:1538: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'." >&2;}
@@ -1525,24 +1543,24 @@ If you meant to cross compile, use \`--host'." >&2;}
fi
fi
fi
-echo "$as_me:1528: result: yes" >&5
+echo "$as_me:1546: result: yes" >&5
echo "${ECHO_T}yes" >&6
rm -f a.out a.exe conftest$ac_cv_exeext
ac_clean_files=$ac_clean_files_save
# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:1535: checking whether we are cross compiling" >&5
+echo "$as_me:1553: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1537: result: $cross_compiling" >&5
+echo "$as_me:1555: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6
-echo "$as_me:1540: checking for executable suffix" >&5
+echo "$as_me:1558: checking for executable suffix" >&5
echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1542: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:1545: \$? = $ac_status" >&5
+ echo "$as_me:1563: \$? = $ac_status" >&5
(exit $ac_status); }; then
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
@@ -1558,29 +1576,29 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
esac
done
else
- { { echo "$as_me:1561: error: cannot compute EXEEXT: cannot compile and link" >&5
+ { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:1567: result: $ac_cv_exeext" >&5
+echo "$as_me:1585: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:1573: checking for object suffix" >&5
+echo "$as_me:1591: checking for object suffix" >&5
echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1579 "configure"
+#line 1597 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -1588,10 +1606,10 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1591: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1594: \$? = $ac_status" >&5
+ echo "$as_me:1612: \$? = $ac_status" >&5
(exit $ac_status); }; then
for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
@@ -1603,28 +1621,28 @@ done
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-{ { echo "$as_me:1606: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:1613: result: $ac_cv_objext" >&5
+echo "$as_me:1631: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:1617: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1623 "configure"
+#line 1641 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -1635,16 +1653,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1641: \$? = $ac_status" >&5
+ echo "$as_me:1659: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1644: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1662: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1647: \$? = $ac_status" >&5
+ echo "$as_me:1665: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_compiler_gnu=yes
else
@@ -1656,23 +1674,23 @@ rm -f conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:1659: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
CFLAGS="-g"
-echo "$as_me:1665: checking whether $CC accepts -g" >&5
+echo "$as_me:1683: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 1671 "configure"
+#line 1689 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -1680,16 +1698,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1683: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1686: \$? = $ac_status" >&5
+ echo "$as_me:1704: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1689: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1707: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1692: \$? = $ac_status" >&5
+ echo "$as_me:1710: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
@@ -1699,7 +1717,7 @@ ac_cv_prog_cc_g=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:1702: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
@@ -1726,16 +1744,16 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1732: \$? = $ac_status" >&5
+ echo "$as_me:1750: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1735: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1753: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1738: \$? = $ac_status" >&5
+ echo "$as_me:1756: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
''\
@@ -1747,12 +1765,12 @@ if { (eval echo "$as_me:1729: \"$ac_compile\"") >&5
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line 1750 "configure"
+#line 1768 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
int
-main ()
+main (void)
{
exit (42);
;
@@ -1760,16 +1778,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1763: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1766: \$? = $ac_status" >&5
+ echo "$as_me:1784: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1769: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1787: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1772: \$? = $ac_status" >&5
+ echo "$as_me:1790: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -1779,11 +1797,11 @@ continue
fi
rm -f conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line 1782 "configure"
+#line 1800 "configure"
#include "confdefs.h"
$ac_declaration
int
-main ()
+main (void)
{
exit (42);
;
@@ -1791,16 +1809,16 @@ exit (42);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1794: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1797: \$? = $ac_status" >&5
+ echo "$as_me:1815: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1800: \"$ac_try\"") >&5
+ { (eval echo "$as_me:1818: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1803: \$? = $ac_status" >&5
+ echo "$as_me:1821: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
break
else
@@ -1830,15 +1848,117 @@ ac_main_return=return
GCC_VERSION=none
if test "$GCC" = yes ; then
- echo "$as_me:1833: checking version of $CC" >&5
+ echo "$as_me:1851: checking version of $CC" >&5
echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
- echo "$as_me:1837: result: $GCC_VERSION" >&5
+ echo "$as_me:1855: result: $GCC_VERSION" >&5
echo "${ECHO_T}$GCC_VERSION" >&6
fi
-echo "$as_me:1841: checking for $CC option to accept ANSI C" >&5
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+ case $host_os in
+ (linux*|gnu*)
+ echo "$as_me:1864: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -no-gcc"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1869 "configure"
+#include "confdefs.h"
+
+int
+main (void)
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1886: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1889: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1892: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1895: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ echo "$as_me:1906: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+ ;;
+ esac
+fi
+
+CLANG_COMPILER=no
+
+if test "$GCC" = yes ; then
+ echo "$as_me:1915: checking if this is really Clang C compiler" >&5
+echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Qunused-arguments"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1920 "configure"
+#include "confdefs.h"
+
+int
+main (void)
+{
+
+#ifdef __clang__
+#else
+make an error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1937: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1940: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1943: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1946: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ CLANG_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ echo "$as_me:1957: result: $CLANG_COMPILER" >&5
+echo "${ECHO_T}$CLANG_COMPILER" >&6
+fi
+
+echo "$as_me:1961: checking for $CC option to accept ANSI C" >&5
echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
if test "${ac_cv_prog_cc_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1846,7 +1966,7 @@ else
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
-#line 1849 "configure"
+#line 1969 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1877,7 +1997,7 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i
int argc;
char **argv;
int
-main ()
+main (void)
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
@@ -1895,16 +2015,16 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2018: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:1901: \$? = $ac_status" >&5
+ echo "$as_me:2021: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:1904: \"$ac_try\"") >&5
+ { (eval echo "$as_me:2024: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:1907: \$? = $ac_status" >&5
+ echo "$as_me:2027: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_prog_cc_stdc=$ac_arg
break
@@ -1921,10 +2041,10 @@ fi
case "x$ac_cv_prog_cc_stdc" in
x|xno)
- echo "$as_me:1924: result: none needed" >&5
+ echo "$as_me:2044: result: none needed" >&5
echo "${ECHO_T}none needed" >&6 ;;
*)
- echo "$as_me:1927: result: $ac_cv_prog_cc_stdc" >&5
+ echo "$as_me:2047: result: $ac_cv_prog_cc_stdc" >&5
echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
@@ -1932,31 +2052,155 @@ esac
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
-echo "$as_me:1935: checking \$CC variable" >&5
+echo "$as_me:2055: checking \$CFLAGS variable" >&5
+echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
+case "x$CFLAGS" in
+(*-[IUD]*)
+ echo "$as_me:2059: result: broken" >&5
+echo "${ECHO_T}broken" >&6
+ { echo "$as_me:2061: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
+ cf_flags="$CFLAGS"
+ CFLAGS=
+ for cf_arg in $cf_flags
+ do
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_arg
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+ done
+ ;;
+(*)
+ echo "$as_me:2169: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+ ;;
+esac
+
+echo "$as_me:2174: checking \$CC variable" >&5
echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
-case "$CC" in #(vi
-*[\ \ ]-[IUD]*)
- echo "$as_me:1939: result: broken" >&5
+case "$CC" in
+(*[\ \ ]-*)
+ echo "$as_me:2178: result: broken" >&5
echo "${ECHO_T}broken" >&6
- { echo "$as_me:1941: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
-echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
+ { echo "$as_me:2180: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
+echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
# humor him...
- cf_flags=`echo "$CC" | sed -e 's/^[^ ]*[ ]//'`
- CC=`echo "$CC" | sed -e 's/[ ].*//'`
+ cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
+ cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
+ CC="$cf_prog"
+ for cf_arg in $cf_flags
+ do
+ case "x$cf_arg" in
+ (x-[IUDfgOW]*)
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
-for cf_add_cflags in $cf_flags
+for cf_add_cflags in $cf_arg
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -1964,20 +2208,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -1986,17 +2236,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -2009,33 +2267,109 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
+ ;;
+ (*)
+ CC="$CC $cf_arg"
+ ;;
+ esac
+ done
+ test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6
+
+echo "${as_me:-configure}:2297: testing resulting CC: '$CC' ..." 1>&5
+
+ test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6
+
+echo "${as_me:-configure}:2301: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
+
+ test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
+
+echo "${as_me:-configure}:2305: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
+
;;
-*)
- echo "$as_me:2027: result: ok" >&5
+(*)
+ echo "$as_me:2309: result: ok" >&5
echo "${ECHO_T}ok" >&6
;;
esac
+echo "$as_me:2314: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2322 "configure"
+#include "confdefs.h"
+#ifndef __cplusplus
+static $ac_kw int static_foo () {return 0; }
+$ac_kw int foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2331: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2334: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2337: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2340: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:2351: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ no)
+cat >>confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >>confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_main_return=return
-echo "$as_me:2038: checking how to run the C preprocessor" >&5
+echo "$as_me:2372: checking how to run the C preprocessor" >&5
echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
@@ -2056,18 +2390,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 2059 "configure"
+#line 2393 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:2064: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2398: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2070: \$? = $ac_status" >&5
+ echo "$as_me:2404: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2090,17 +2424,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 2093 "configure"
+#line 2427 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:2097: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2431: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2103: \$? = $ac_status" >&5
+ echo "$as_me:2437: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2137,7 +2471,7 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:2140: result: $CPP" >&5
+echo "$as_me:2474: result: $CPP" >&5
echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
@@ -2147,18 +2481,18 @@ do
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
-#line 2150 "configure"
+#line 2484 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax error
_ACEOF
-if { (eval echo "$as_me:2155: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2489: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2161: \$? = $ac_status" >&5
+ echo "$as_me:2495: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2181,17 +2515,17 @@ rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
-#line 2184 "configure"
+#line 2518 "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:2188: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2522: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:2194: \$? = $ac_status" >&5
+ echo "$as_me:2528: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2219,7 +2553,7 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:2222: error: C preprocessor \"$CPP\" fails sanity check" >&5
+ { { echo "$as_me:2556: error: C preprocessor \"$CPP\" fails sanity check" >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -2235,7 +2569,7 @@ for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2238: checking for $ac_word" >&5
+echo "$as_me:2572: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2250,7 +2584,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:2253: found $ac_dir/$ac_word" >&5
+echo "$as_me:2587: found $ac_dir/$ac_word" >&5
break
done
@@ -2258,10 +2592,10 @@ fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:2261: result: $AWK" >&5
+ echo "$as_me:2595: result: $AWK" >&5
echo "${ECHO_T}$AWK" >&6
else
- echo "$as_me:2264: result: no" >&5
+ echo "$as_me:2598: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2280,7 +2614,7 @@ done
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:2283: checking for a BSD compatible install" >&5
+echo "$as_me:2617: checking for a BSD compatible install" >&5
echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
@@ -2329,7 +2663,7 @@ fi
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:2332: result: $INSTALL" >&5
+echo "$as_me:2666: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2341,20 +2675,102 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
case $INSTALL in
-/*)
- ;;
-*)
- cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
- test -z "$cf_dir" && cf_dir=.
- INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
- ;;
+(/*)
+ ;;
+(*)
+ cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
+ test -z "$cf_dir" && cf_dir=.
+ INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
+ ;;
+esac
+
+echo "$as_me:2687: checking if you want to install stripped executables" >&5
+echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
+
+# Check whether --enable-stripping or --disable-stripping was given.
+if test "${enable_stripping+set}" = set; then
+ enableval="$enable_stripping"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ with_stripping=no
+ else
+ with_stripping=yes
+ fi
+else
+ enableval=yes
+ with_stripping=yes
+
+fi;
+echo "$as_me:2704: result: $with_stripping" >&5
+echo "${ECHO_T}$with_stripping" >&6
+
+if test "$with_stripping" = yes
+then
+ INSTALL_OPT_S="-s"
+else
+ INSTALL_OPT_S=
+fi
+
+: ${INSTALL:=install}
+echo "$as_me:2715: checking if install accepts -p option" >&5
+echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
+if test "${cf_cv_install_p+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ rm -rf conftest*
+ date >conftest.in
+ mkdir conftest.out
+ sleep 3
+ if $INSTALL -p conftest.in conftest.out 2>/dev/null
+ then
+ if test -f conftest.out/conftest.in
+ then
+ test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
+ test conftest.out/conftest.in -nt conftest.in 2>conftest.err
+ if test -s conftest.err
+ then
+ cf_cv_install_p=no
+ else
+ cf_cv_install_p=yes
+ fi
+ else
+ cf_cv_install_p=no
+ fi
+ else
+ cf_cv_install_p=no
+ fi
+ rm -rf conftest*
+
+fi
+echo "$as_me:2746: result: $cf_cv_install_p" >&5
+echo "${ECHO_T}$cf_cv_install_p" >&6
+
+echo "$as_me:2749: checking if install needs to be told about ownership" >&5
+echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
+case `$ac_config_guess` in
+(*minix)
+ with_install_o=yes
+ ;;
+(*)
+ with_install_o=no
+ ;;
esac
-for ac_prog in tdlint lint alint splint lclint
+echo "$as_me:2760: result: $with_install_o" >&5
+echo "${ECHO_T}$with_install_o" >&6
+if test "x$with_install_o" = xyes
+then
+ INSTALL_OPT_O=`id root|sed -e 's/uid=[0-9]*(/ -o /' -e 's/gid=[0-9]*(/ -g /' -e 's/ [^=[:space:]][^=[:space:]]*=.*/ /' -e 's/)//g'`
+else
+ INSTALL_OPT_O=
+fi
+
+for ac_prog in lint cppcheck splint
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2357: checking for $ac_word" >&5
+echo "$as_me:2773: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_LINT+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2369,7 +2785,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_LINT="$ac_prog"
-echo "$as_me:2372: found $ac_dir/$ac_word" >&5
+echo "$as_me:2788: found $ac_dir/$ac_word" >&5
break
done
@@ -2377,28 +2793,34 @@ fi
fi
LINT=$ac_cv_prog_LINT
if test -n "$LINT"; then
- echo "$as_me:2380: result: $LINT" >&5
+ echo "$as_me:2796: result: $LINT" >&5
echo "${ECHO_T}$LINT" >&6
else
- echo "$as_me:2383: result: no" >&5
+ echo "$as_me:2799: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$LINT" && break
done
-echo "$as_me:2390: checking if filesystem supports mixed-case filenames" >&5
+case "x$LINT" in
+(xcppcheck|x*/cppcheck)
+ test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
+ ;;
+esac
+
+echo "$as_me:2812: checking if filesystem supports mixed-case filenames" >&5
echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
if test "${cf_cv_mixedcase+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes ; then
- case $target_alias in #(vi
- *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) #(vi
+ case $target_alias in
+ (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
cf_cv_mixedcase=no
;;
- *)
+ (*)
cf_cv_mixedcase=yes
;;
esac
@@ -2414,7 +2836,7 @@ else
fi
fi
-echo "$as_me:2417: result: $cf_cv_mixedcase" >&5
+echo "$as_me:2839: result: $cf_cv_mixedcase" >&5
echo "${ECHO_T}$cf_cv_mixedcase" >&6
test "$cf_cv_mixedcase" = yes &&
cat >>confdefs.h <<\EOF
@@ -2425,7 +2847,7 @@ for ac_prog in exctags ctags
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2428: checking for $ac_word" >&5
+echo "$as_me:2850: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CTAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2440,7 +2862,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_CTAGS="$ac_prog"
-echo "$as_me:2443: found $ac_dir/$ac_word" >&5
+echo "$as_me:2865: found $ac_dir/$ac_word" >&5
break
done
@@ -2448,10 +2870,10 @@ fi
fi
CTAGS=$ac_cv_prog_CTAGS
if test -n "$CTAGS"; then
- echo "$as_me:2451: result: $CTAGS" >&5
+ echo "$as_me:2873: result: $CTAGS" >&5
echo "${ECHO_T}$CTAGS" >&6
else
- echo "$as_me:2454: result: no" >&5
+ echo "$as_me:2876: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2462,7 +2884,7 @@ for ac_prog in exetags etags
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:2465: checking for $ac_word" >&5
+echo "$as_me:2887: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ETAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2477,7 +2899,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ETAGS="$ac_prog"
-echo "$as_me:2480: found $ac_dir/$ac_word" >&5
+echo "$as_me:2902: found $ac_dir/$ac_word" >&5
break
done
@@ -2485,10 +2907,10 @@ fi
fi
ETAGS=$ac_cv_prog_ETAGS
if test -n "$ETAGS"; then
- echo "$as_me:2488: result: $ETAGS" >&5
+ echo "$as_me:2910: result: $ETAGS" >&5
echo "${ECHO_T}$ETAGS" >&6
else
- echo "$as_me:2491: result: no" >&5
+ echo "$as_me:2913: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2497,7 +2919,7 @@ done
# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
set dummy ${CTAGS:-ctags}; ac_word=$2
-echo "$as_me:2500: checking for $ac_word" >&5
+echo "$as_me:2922: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2512,7 +2934,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:2515: found $ac_dir/$ac_word" >&5
+echo "$as_me:2937: found $ac_dir/$ac_word" >&5
break
done
@@ -2521,17 +2943,17 @@ fi
fi
MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
if test -n "$MAKE_LOWER_TAGS"; then
- echo "$as_me:2524: result: $MAKE_LOWER_TAGS" >&5
+ echo "$as_me:2946: result: $MAKE_LOWER_TAGS" >&5
echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
else
- echo "$as_me:2527: result: no" >&5
+ echo "$as_me:2949: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$cf_cv_mixedcase" = yes ; then
# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
set dummy ${ETAGS:-etags}; ac_word=$2
-echo "$as_me:2534: checking for $ac_word" >&5
+echo "$as_me:2956: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2546,7 +2968,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:2549: found $ac_dir/$ac_word" >&5
+echo "$as_me:2971: found $ac_dir/$ac_word" >&5
break
done
@@ -2555,10 +2977,10 @@ fi
fi
MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
if test -n "$MAKE_UPPER_TAGS"; then
- echo "$as_me:2558: result: $MAKE_UPPER_TAGS" >&5
+ echo "$as_me:2980: result: $MAKE_UPPER_TAGS" >&5
echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
else
- echo "$as_me:2561: result: no" >&5
+ echo "$as_me:2983: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -2578,21 +3000,22 @@ else
MAKE_LOWER_TAGS="#"
fi
-echo "$as_me:2581: checking if -lm needed for math functions" >&5
+echo "$as_me:3003: checking if -lm needed for math functions" >&5
echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
if test "${cf_cv_need_libm+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 2588 "configure"
+#line 3010 "configure"
#include "confdefs.h"
#include <stdio.h>
+ #include <stdlib.h>
#include <math.h>
int
-main ()
+main (void)
{
double x = rand(); printf("result = %g\n", pow(sin(x),x))
;
@@ -2600,16 +3023,16 @@ double x = rand(); printf("result = %g\n", pow(sin(x),x))
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:2603: \"$ac_link\"") >&5
+if { (eval echo "$as_me:3026: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:2606: \$? = $ac_status" >&5
+ echo "$as_me:3029: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:2609: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3032: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2612: \$? = $ac_status" >&5
+ echo "$as_me:3035: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_need_libm=no
else
@@ -2619,7 +3042,7 @@ cf_cv_need_libm=yes
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:2622: result: $cf_cv_need_libm" >&5
+echo "$as_me:3045: result: $cf_cv_need_libm" >&5
echo "${ECHO_T}$cf_cv_need_libm" >&6
if test "$cf_cv_need_libm" = yes
then
@@ -2640,11 +3063,13 @@ LDFLAGS_STATIC=""
LD_MODEL=""
LD_SHARED_OPTS=""
LIBTOOL=""
+LIBTOOL_OPTS=""
LIB_CLEAN=""
LIB_COMPILE=""
LIB_LINK='${CC}'
LINK_TESTS=""
LOCAL_LDFLAGS=""
+PACKAGE="ncurses-examples"
PTHREAD="-lm"
TEST_ARGS=""
TEST_DEPS=""
@@ -2676,10 +3101,10 @@ cat > conftest.i <<EOF
EOF
if test "$GCC" = yes
then
- { echo "$as_me:2679: checking for $CC __attribute__ directives..." >&5
+ { echo "$as_me:3104: checking for $CC __attribute__ directives..." >&5
echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
cat > conftest.$ac_ext <<EOF
-#line 2682 "${as_me:-configure}"
+#line 3107 "${as_me:-configure}"
#include "confdefs.h"
#include "conftest.h"
#include "conftest.i"
@@ -2708,43 +3133,43 @@ cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFG
cf_directive="__attribute__(($cf_attribute))"
echo "checking for $CC $cf_directive" 1>&5
- case $cf_attribute in #(vi
- printf) #(vi
+ case $cf_attribute in
+ (printf)
cf_printf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- scanf) #(vi
+ (scanf)
cf_scanf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- *) #(vi
+ (*)
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE $cf_directive
EOF
;;
esac
- if { (eval echo "$as_me:2731: \"$ac_compile\"") >&5
+ if { (eval echo "$as_me:3156: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2734: \$? = $ac_status" >&5
+ echo "$as_me:3159: \$? = $ac_status" >&5
(exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:2736: result: ... $cf_attribute" >&5
+ test -n "$verbose" && echo "$as_me:3161: result: ... $cf_attribute" >&5
echo "${ECHO_T}... $cf_attribute" >&6
cat conftest.h >>confdefs.h
- case $cf_attribute in #(vi
- noreturn) #(vi
+ case $cf_attribute in
+ (noreturn)
cat >>confdefs.h <<EOF
#define GCC_NORETURN $cf_directive
EOF
;;
- printf) #(vi
+ (printf)
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
@@ -2760,7 +3185,7 @@ cat >>confdefs.h <<EOF
EOF
;;
- scanf) #(vi
+ (scanf)
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
@@ -2776,7 +3201,7 @@ cat >>confdefs.h <<EOF
EOF
;;
- unused) #(vi
+ (unused)
cat >>confdefs.h <<EOF
#define GCC_UNUSED $cf_directive
@@ -2792,25 +3217,357 @@ fi
rm -rf conftest*
fi
-cf_XOPEN_SOURCE=500
+echo "$as_me:3220: checking if you want to work around bogus compiler/loader warnings" >&5
+echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
+
+# Check whether --enable-string-hacks or --disable-string-hacks was given.
+if test "${enable_string_hacks+set}" = set; then
+ enableval="$enable_string_hacks"
+ with_string_hacks=$enableval
+else
+ with_string_hacks=no
+fi;
+echo "$as_me:3230: result: $with_string_hacks" >&5
+echo "${ECHO_T}$with_string_hacks" >&6
+
+if test "x$with_string_hacks" = "xyes"; then
+
+cat >>confdefs.h <<\EOF
+#define USE_STRING_HACKS 1
+EOF
+
+ { echo "$as_me:3239: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
+echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
+ echo "$as_me:3241: checking for strlcat" >&5
+echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
+if test "${ac_cv_func_strlcat+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3247 "configure"
+#include "confdefs.h"
+#define strlcat autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef strlcat
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strlcat (void);
+
+int
+main (void)
+{
+
+/* The GNU C library defines stubs for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_strlcat) || defined (__stub___strlcat)
+#error found stub for strlcat
+#endif
+
+ return strlcat ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3278: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:3281: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:3284: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3287: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_strlcat=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_strlcat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:3297: result: $ac_cv_func_strlcat" >&5
+echo "${ECHO_T}$ac_cv_func_strlcat" >&6
+if test $ac_cv_func_strlcat = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_STRLCAT 1
+EOF
+
+else
+
+ echo "$as_me:3307: checking for strlcat in -lbsd" >&5
+echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 3315 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strlcat ();
+int
+main (void)
+{
+strlcat ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3334: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:3337: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:3340: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3343: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bsd_strlcat=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_bsd_strlcat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:3354: result: $ac_cv_lib_bsd_strlcat" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
+if test $ac_cv_lib_bsd_strlcat = yes; then
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+for ac_header in bsd/string.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:3377: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3383 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:3387: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:3393: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:3412: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cat >>confdefs.h <<\EOF
+#define HAVE_STRLCAT 1
+EOF
+
+fi
+
+fi
+
+for ac_func in strlcpy snprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:3433: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3439 "configure"
+#include "confdefs.h"
+#define $ac_func autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef $ac_func
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func (void);
+
+int
+main (void)
+{
+
+/* The GNU C library defines stubs for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#error found stub for $ac_func
+#endif
+
+ return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3470: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:3473: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:3476: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3479: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:3489: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+fi
+
+echo "$as_me:3501: checking if the POSIX test-macros are already defined" >&5
+echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
+if test "${cf_cv_posix_visible+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 3508 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main (void)
+{
+
+#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
+ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
+ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
+ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
+#error conflicting symbols found
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3527: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3530: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3533: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3536: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_posix_visible=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_visible=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3547: result: $cf_cv_posix_visible" >&5
+echo "${ECHO_T}$cf_cv_posix_visible" >&6
+
+if test "$cf_cv_posix_visible" = no; then
+
+cf_XOPEN_SOURCE=600
cf_POSIX_C_SOURCE=199506L
cf_xopen_source=
-case $host_os in #(vi
-aix[4-7]*) #(vi
+case $host_os in
+(aix[4-7]*)
cf_xopen_source="-D_ALL_SOURCE"
;;
-cygwin|msys) #(vi
+(msys)
cf_XOPEN_SOURCE=600
;;
-darwin[0-8].*) #(vi
+(darwin[0-8].*)
cf_xopen_source="-D_APPLE_C_SOURCE"
;;
-darwin*) #(vi
+(darwin*)
cf_xopen_source="-D_DARWIN_C_SOURCE"
cf_XOPEN_SOURCE=
;;
-freebsd*|dragonfly*) #(vi
+(freebsd*|dragonfly*|midnightbsd*)
# 5.x headers associate
# _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
# _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
@@ -2818,83 +3575,448 @@ freebsd*|dragonfly*) #(vi
cf_XOPEN_SOURCE=600
cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
;;
-hpux11*) #(vi
+(hpux11*)
cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
;;
-hpux*) #(vi
+(hpux*)
cf_xopen_source="-D_HPUX_SOURCE"
;;
-irix[56].*) #(vi
+(irix[56].*)
cf_xopen_source="-D_SGI_SOURCE"
cf_XOPEN_SOURCE=
;;
-linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
+
+cf_gnu_xopen_source=$cf_XOPEN_SOURCE
+
+echo "$as_me:3592: checking if this is the GNU C library" >&5
+echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
+if test "${cf_cv_gnu_library+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 3599 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main (void)
+{
-echo "$as_me:2833: checking if we must define _GNU_SOURCE" >&5
+ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
+ return 0;
+ #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
+ return 0;
+ #else
+ # error not GNU C library
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3618: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3621: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3624: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3627: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_gnu_library=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_library=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3638: result: $cf_cv_gnu_library" >&5
+echo "${ECHO_T}$cf_cv_gnu_library" >&6
+
+if test x$cf_cv_gnu_library = xyes; then
+
+ # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
+ # was changed to help a little. newlib incorporated the change about 4
+ # years later.
+ echo "$as_me:3646: checking if _DEFAULT_SOURCE can be used as a basis" >&5
+echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
+if test "${cf_cv_gnu_library_219+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_save="$CPPFLAGS"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3658 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main (void)
+{
+
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
+ return 0;
+ #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
+ return 0;
+ #else
+ # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3677: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3680: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3683: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3686: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_gnu_library_219=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_library_219=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$cf_save"
+
+fi
+echo "$as_me:3698: result: $cf_cv_gnu_library_219" >&5
+echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
+
+ if test "x$cf_cv_gnu_library_219" = xyes; then
+ cf_save="$CPPFLAGS"
+ echo "$as_me:3703: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3808 "configure"
+#include "confdefs.h"
+
+ #include <limits.h>
+ #include <sys/types.h>
+
+int
+main (void)
+{
+
+ #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
+ return 0;
+ #else
+ # error GNU C library is too old
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3828: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3831: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3834: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3837: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_gnu_dftsrc_219=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_dftsrc_219=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3848: result: $cf_cv_gnu_dftsrc_219" >&5
+echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
+ test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
+ else
+ cf_cv_gnu_dftsrc_219=maybe
+ fi
+
+ if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
+
+ echo "$as_me:3857: checking if we must define _GNU_SOURCE" >&5
echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
if test "${cf_cv_gnu_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-cat >conftest.$ac_ext <<_ACEOF
-#line 2840 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3864 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
+ #ifndef _XOPEN_SOURCE
+ #error expected _XOPEN_SOURCE to be defined
+ #endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2855: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3879: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2858: \$? = $ac_status" >&5
+ echo "$as_me:3882: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2861: \"$ac_try\"") >&5
+ { (eval echo "$as_me:3885: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2864: \$? = $ac_status" >&5
+ echo "$as_me:3888: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
- cat >conftest.$ac_ext <<_ACEOF
-#line 2873 "configure"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -D_GNU_SOURCE
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3995 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
-#ifdef _XOPEN_SOURCE
-make an error
-#endif
+ #ifdef _XOPEN_SOURCE
+ #error expected _XOPEN_SOURCE to be undefined
+ #endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2888: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2891: \$? = $ac_status" >&5
+ echo "$as_me:4013: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2894: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4016: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2897: \$? = $ac_status" >&5
+ echo "$as_me:4019: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_gnu_source=no
else
@@ -2903,24 +4025,86 @@ cat conftest.$ac_ext >&5
cf_cv_gnu_source=yes
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS="$cf_save"
+ CPPFLAGS="$cf_save"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:2912: result: $cf_cv_gnu_source" >&5
+echo "$as_me:4034: result: $cf_cv_gnu_source" >&5
echo "${ECHO_T}$cf_cv_gnu_source" >&6
-test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+ if test "$cf_cv_gnu_source" = yes
+ then
+ echo "$as_me:4039: checking if we should also define _DEFAULT_SOURCE" >&5
+echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_default_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4049 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main (void)
+{
+
+ #ifdef _DEFAULT_SOURCE
+ #error expected _DEFAULT_SOURCE to be undefined
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4064: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:4067: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4070: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4073: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_default_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_default_source=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:4084: result: $cf_cv_default_source" >&5
+echo "${ECHO_T}$cf_cv_default_source" >&6
+ if test "$cf_cv_default_source" = yes
+ then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
+
+ fi
+ fi
+ fi
+
+fi
;;
-minix*) #(vi
+(minix*)
cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
;;
-mirbsd*) #(vi
+(mirbsd*)
# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
cf_XOPEN_SOURCE=
+if test "$cf_cv_posix_visible" = no; then
+
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
cf_save_CFLAGS="$CFLAGS"
@@ -2934,20 +4118,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
-echo "$as_me:2937: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:4121: checking if we should define _POSIX_C_SOURCE" >&5
echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
if test "${cf_cv_posix_c_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-echo "${as_me:-configure}:2943: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:4127: testing if the symbol is already defined go no further ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 2946 "configure"
+#line 4130 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _POSIX_C_SOURCE
@@ -2958,41 +4142,41 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2961: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4145: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:2964: \$? = $ac_status" >&5
+ echo "$as_me:4148: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:2967: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4151: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:2970: \$? = $ac_status" >&5
+ echo "$as_me:4154: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_posix_c_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_want_posix_source=no
- case .$cf_POSIX_C_SOURCE in #(vi
- .[12]??*) #(vi
+ case .$cf_POSIX_C_SOURCE in
+ (.[12]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
- .2) #(vi
+ (.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
- .*)
+ (.*)
cf_want_posix_source=yes
;;
esac
if test "$cf_want_posix_source" = yes ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 2991 "configure"
+#line 4175 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifdef _POSIX_SOURCE
@@ -3003,16 +4187,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3006: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4190: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3009: \$? = $ac_status" >&5
+ echo "$as_me:4193: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3012: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4196: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3015: \$? = $ac_status" >&5
+ echo "$as_me:4199: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3023,19 +4207,22 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "${as_me:-configure}:3026: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:4210: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
CFLAGS="$cf_trim_CFLAGS"
- CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+ CPPFLAGS="$cf_trim_CPPFLAGS"
-echo "${as_me:-configure}:3031: testing if the second compile does not leave our definition intact error ..." 1>&5
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:4218: testing if the second compile does not leave our definition intact error ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 3034 "configure"
+#line 4221 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _POSIX_C_SOURCE
@@ -3046,16 +4233,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3049: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4236: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3052: \$? = $ac_status" >&5
+ echo "$as_me:4239: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3055: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4242: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3058: \$? = $ac_status" >&5
+ echo "$as_me:4245: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3071,7 +4258,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3074: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:4261: result: $cf_cv_posix_c_source" >&5
echo "${ECHO_T}$cf_cv_posix_c_source" >&6
if test "$cf_cv_posix_c_source" != no ; then
@@ -3086,11 +4273,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_cv_posix_c_source
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -3098,20 +4285,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -3120,17 +4313,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -3143,60 +4344,68 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
fi
+fi # cf_cv_posix_visible
+
;;
-netbsd*) #(vi
+(netbsd*)
cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
;;
-openbsd[4-9]*) #(vi
+(openbsd[4-9]*)
# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
cf_xopen_source="-D_BSD_SOURCE"
cf_XOPEN_SOURCE=600
;;
-openbsd*) #(vi
+(openbsd*)
# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
;;
-osf[45]*) #(vi
+(osf[45]*)
cf_xopen_source="-D_OSF_SOURCE"
;;
-nto-qnx*) #(vi
+(nto-qnx*)
cf_xopen_source="-D_QNX_SOURCE"
;;
-sco*) #(vi
+(sco*)
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
-solaris2.*) #(vi
+(solaris2.*)
cf_xopen_source="-D__EXTENSIONS__"
cf_cv_xopen_source=broken
;;
-sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
cf_XOPEN_SOURCE=
cf_POSIX_C_SOURCE=
;;
-*)
+(*)
-echo "$as_me:3192: checking if we should define _XOPEN_SOURCE" >&5
+echo "$as_me:4401: checking if we should define _XOPEN_SOURCE" >&5
echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3199 "configure"
+#line 4408 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3204,7 +4413,7 @@ else
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _XOPEN_SOURCE
@@ -3215,25 +4424,28 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3218: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4427: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3221: \$? = $ac_status" >&5
+ echo "$as_me:4430: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3224: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4433: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3227: \$? = $ac_status" >&5
+ echo "$as_me:4436: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 3236 "configure"
+#line 4448 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3241,7 +4453,7 @@ cf_save="$CPPFLAGS"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifdef _XOPEN_SOURCE
@@ -3252,16 +4464,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3255: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4467: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3258: \$? = $ac_status" >&5
+ echo "$as_me:4470: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3261: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4473: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3264: \$? = $ac_status" >&5
+ echo "$as_me:4476: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
@@ -3276,7 +4488,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3279: result: $cf_cv_xopen_source" >&5
+echo "$as_me:4491: result: $cf_cv_xopen_source" >&5
echo "${ECHO_T}$cf_cv_xopen_source" >&6
if test "$cf_cv_xopen_source" != no ; then
@@ -3299,11 +4511,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_temp_xopen_source
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -3311,20 +4523,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -3333,17 +4551,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -3356,21 +4582,29 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
fi
+if test "$cf_cv_posix_visible" = no; then
+
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
cf_save_CFLAGS="$CFLAGS"
@@ -3384,20 +4618,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'`
-echo "$as_me:3387: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:4621: checking if we should define _POSIX_C_SOURCE" >&5
echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
if test "${cf_cv_posix_c_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-echo "${as_me:-configure}:3393: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:4627: testing if the symbol is already defined go no further ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 3396 "configure"
+#line 4630 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _POSIX_C_SOURCE
@@ -3408,41 +4642,41 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3411: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4645: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3414: \$? = $ac_status" >&5
+ echo "$as_me:4648: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3417: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4651: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3420: \$? = $ac_status" >&5
+ echo "$as_me:4654: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_posix_c_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_want_posix_source=no
- case .$cf_POSIX_C_SOURCE in #(vi
- .[12]??*) #(vi
+ case .$cf_POSIX_C_SOURCE in
+ (.[12]??*)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
;;
- .2) #(vi
+ (.2)
cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
cf_want_posix_source=yes
;;
- .*)
+ (.*)
cf_want_posix_source=yes
;;
esac
if test "$cf_want_posix_source" = yes ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 3441 "configure"
+#line 4675 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifdef _POSIX_SOURCE
@@ -3453,16 +4687,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3456: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4690: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3459: \$? = $ac_status" >&5
+ echo "$as_me:4693: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3462: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4696: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3465: \$? = $ac_status" >&5
+ echo "$as_me:4699: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3473,19 +4707,22 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "${as_me:-configure}:3476: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:4710: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
CFLAGS="$cf_trim_CFLAGS"
- CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+ CPPFLAGS="$cf_trim_CPPFLAGS"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
-echo "${as_me:-configure}:3481: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:4718: testing if the second compile does not leave our definition intact error ..." 1>&5
cat >conftest.$ac_ext <<_ACEOF
-#line 3484 "configure"
+#line 4721 "configure"
#include "confdefs.h"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _POSIX_C_SOURCE
@@ -3496,16 +4733,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3499: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4736: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3502: \$? = $ac_status" >&5
+ echo "$as_me:4739: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3505: \"$ac_try\"") >&5
+ { (eval echo "$as_me:4742: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3508: \$? = $ac_status" >&5
+ echo "$as_me:4745: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -3521,7 +4758,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3524: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:4761: result: $cf_cv_posix_c_source" >&5
echo "${ECHO_T}$cf_cv_posix_c_source" >&6
if test "$cf_cv_posix_c_source" != no ; then
@@ -3536,11 +4773,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_cv_posix_c_source
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -3548,20 +4785,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -3570,17 +4813,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -3593,21 +4844,29 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
fi
+fi # cf_cv_posix_visible
+
;;
esac
@@ -3621,11 +4880,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_xopen_source
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -3633,20 +4892,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -3655,17 +4920,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -3679,38 +4952,44 @@ done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
-echo "${as_me:-configure}:3682: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:4955: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
- CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-echo "${as_me:-configure}:3690: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:4965: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-echo "${as_me:-configure}:3698: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:4975: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
fi
if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
- echo "$as_me:3706: checking if _XOPEN_SOURCE really is set" >&5
+ echo "$as_me:4985: checking if _XOPEN_SOURCE really is set" >&5
echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 3709 "configure"
+#line 4988 "configure"
#include "confdefs.h"
#include <stdlib.h>
int
-main ()
+main (void)
{
#ifndef _XOPEN_SOURCE
@@ -3721,16 +5000,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3724: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5003: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3727: \$? = $ac_status" >&5
+ echo "$as_me:5006: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3730: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5009: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3733: \$? = $ac_status" >&5
+ echo "$as_me:5012: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_XOPEN_SOURCE_set=yes
else
@@ -3739,16 +5018,16 @@ cat conftest.$ac_ext >&5
cf_XOPEN_SOURCE_set=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:3742: result: $cf_XOPEN_SOURCE_set" >&5
+ echo "$as_me:5021: result: $cf_XOPEN_SOURCE_set" >&5
echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
if test $cf_XOPEN_SOURCE_set = yes
then
cat >conftest.$ac_ext <<_ACEOF
-#line 3747 "configure"
+#line 5026 "configure"
#include "confdefs.h"
#include <stdlib.h>
int
-main ()
+main (void)
{
#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
@@ -3759,16 +5038,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3762: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5041: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3765: \$? = $ac_status" >&5
+ echo "$as_me:5044: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3768: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5047: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3771: \$? = $ac_status" >&5
+ echo "$as_me:5050: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_XOPEN_SOURCE_set_ok=yes
else
@@ -3779,19 +5058,19 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test $cf_XOPEN_SOURCE_set_ok = no
then
- { echo "$as_me:3782: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+ { echo "$as_me:5061: WARNING: _XOPEN_SOURCE is lower than requested" >&5
echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
fi
else
-echo "$as_me:3787: checking if we should define _XOPEN_SOURCE" >&5
+echo "$as_me:5066: checking if we should define _XOPEN_SOURCE" >&5
echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
if test "${cf_cv_xopen_source+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 3794 "configure"
+#line 5073 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3799,7 +5078,7 @@ else
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifndef _XOPEN_SOURCE
@@ -3810,25 +5089,28 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3813: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5092: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3816: \$? = $ac_status" >&5
+ echo "$as_me:5095: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3819: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5098: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3822: \$? = $ac_status" >&5
+ echo "$as_me:5101: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_save="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 3831 "configure"
+#line 5113 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3836,7 +5118,7 @@ cf_save="$CPPFLAGS"
#include <sys/types.h>
int
-main ()
+main (void)
{
#ifdef _XOPEN_SOURCE
@@ -3847,16 +5129,16 @@ make an error
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3850: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:3853: \$? = $ac_status" >&5
+ echo "$as_me:5135: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:3856: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5138: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:3859: \$? = $ac_status" >&5
+ echo "$as_me:5141: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xopen_source=no
else
@@ -3871,7 +5153,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:3874: result: $cf_cv_xopen_source" >&5
+echo "$as_me:5156: result: $cf_cv_xopen_source" >&5
echo "${ECHO_T}$cf_cv_xopen_source" >&6
if test "$cf_cv_xopen_source" != no ; then
@@ -3894,11 +5176,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_temp_xopen_source
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -3906,20 +5188,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -3928,17 +5216,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -3951,25 +5247,32 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
fi
fi
fi
+fi # cf_cv_posix_visible
-echo "$as_me:3972: checking for signal global datatype" >&5
+echo "$as_me:5275: checking for signal global datatype" >&5
echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
if test "${cf_cv_sig_atomic_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3981,7 +5284,7 @@ else
"int"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 3984 "configure"
+#line 5287 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -3995,7 +5298,7 @@ static void handler(int sig)
x = 5;
}
int
-main ()
+main (void)
{
signal(SIGINT, handler);
x = 1
@@ -4004,16 +5307,16 @@ signal(SIGINT, handler);
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4007: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4010: \$? = $ac_status" >&5
+ echo "$as_me:5313: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4013: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5316: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4016: \$? = $ac_status" >&5
+ echo "$as_me:5319: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_sig_atomic_t=$cf_type
else
@@ -4027,14 +5330,213 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:4030: result: $cf_cv_sig_atomic_t" >&5
+echo "$as_me:5333: result: $cf_cv_sig_atomic_t" >&5
echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
test "$cf_cv_sig_atomic_t" != no &&
cat >>confdefs.h <<EOF
#define SIG_ATOMIC_T $cf_cv_sig_atomic_t
EOF
-echo "$as_me:4037: checking if you want to use pkg-config" >&5
+# Work around breakage on OS X
+
+echo "$as_me:5342: checking if SIGWINCH is defined" >&5
+echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
+if test "${cf_cv_define_sigwinch+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5349 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main (void)
+{
+int x = SIGWINCH
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5364: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:5367: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:5370: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5373: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_define_sigwinch=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 5380 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main (void)
+{
+int x = SIGWINCH
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5398: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:5401: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:5404: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5407: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_define_sigwinch=maybe
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_define_sigwinch=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:5421: result: $cf_cv_define_sigwinch" >&5
+echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
+
+if test "$cf_cv_define_sigwinch" = maybe ; then
+echo "$as_me:5425: checking for actual SIGWINCH definition" >&5
+echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
+if test "${cf_cv_fixup_sigwinch+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_fixup_sigwinch=unknown
+cf_sigwinch=32
+while test $cf_sigwinch != 1
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5436 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main (void)
+{
+
+#if SIGWINCH != $cf_sigwinch
+make an error
+#endif
+int x = SIGWINCH
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5458: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:5461: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:5464: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5467: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_fixup_sigwinch=$cf_sigwinch
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+cf_sigwinch=`expr $cf_sigwinch - 1`
+done
+
+fi
+echo "$as_me:5481: result: $cf_cv_fixup_sigwinch" >&5
+echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
+
+ if test "$cf_cv_fixup_sigwinch" != unknown ; then
+ CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
+ fi
+fi
+
+# Checks for CODESET support.
+
+echo "$as_me:5491: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5497 "configure"
+#include "confdefs.h"
+#include <langinfo.h>
+int
+main (void)
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5509: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5512: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5515: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5518: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:5529: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_LANGINFO_CODESET 1
+EOF
+
+ fi
+
+echo "$as_me:5539: checking if you want to use pkg-config" >&5
echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
# Check whether --with-pkg-config or --without-pkg-config was given.
@@ -4044,19 +5546,19 @@ if test "${with_pkg_config+set}" = set; then
else
cf_pkg_config=yes
fi;
-echo "$as_me:4047: result: $cf_pkg_config" >&5
+echo "$as_me:5549: result: $cf_pkg_config" >&5
echo "${ECHO_T}$cf_pkg_config" >&6
-case $cf_pkg_config in #(vi
-no) #(vi
+case $cf_pkg_config in
+(no)
PKG_CONFIG=none
;;
-yes) #(vi
+(yes)
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-echo "$as_me:4059: checking for $ac_word" >&5
+echo "$as_me:5561: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4073,7 +5575,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if $as_executable_p "$ac_dir/$ac_word"; then
ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:4076: found $ac_dir/$ac_word" >&5
+ echo "$as_me:5578: found $ac_dir/$ac_word" >&5
break
fi
done
@@ -4084,10 +5586,10 @@ fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
- echo "$as_me:4087: result: $PKG_CONFIG" >&5
+ echo "$as_me:5589: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
- echo "$as_me:4090: result: no" >&5
+ echo "$as_me:5592: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -4096,7 +5598,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
-echo "$as_me:4099: checking for $ac_word" >&5
+echo "$as_me:5601: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4113,7 +5615,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if $as_executable_p "$ac_dir/$ac_word"; then
ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
- echo "$as_me:4116: found $ac_dir/$ac_word" >&5
+ echo "$as_me:5618: found $ac_dir/$ac_word" >&5
break
fi
done
@@ -4125,10 +5627,10 @@ fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
- echo "$as_me:4128: result: $ac_pt_PKG_CONFIG" >&5
+ echo "$as_me:5630: result: $ac_pt_PKG_CONFIG" >&5
echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
else
- echo "$as_me:4131: result: no" >&5
+ echo "$as_me:5633: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -4138,7 +5640,7 @@ else
fi
;;
-*)
+(*)
PKG_CONFIG=$withval
;;
esac
@@ -4147,76 +5649,79 @@ test -z "$PKG_CONFIG" && PKG_CONFIG=none
if test "$PKG_CONFIG" != none ; then
if test "x$prefix" != xNONE; then
- cf_path_syntax="$prefix"
+ cf_path_syntax="$prefix"
else
- cf_path_syntax="$ac_default_prefix"
+ cf_path_syntax="$ac_default_prefix"
fi
-case ".$PKG_CONFIG" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
- ;;
-..|./*|.\\*) #(vi
- ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
- ;;
-.\${*prefix}*|.\${*dir}*) #(vi
- eval PKG_CONFIG="$PKG_CONFIG"
- case ".$PKG_CONFIG" in #(vi
- .NONE/*)
- PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
- ;;
- esac
- ;; #(vi
-.no|.NONE/*)
- PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
- ;;
-*)
- { { echo "$as_me:4174: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+case ".$PKG_CONFIG" in
+(.\$\(*\)*|.\'*\'*)
+ ;;
+(..|./*|.\\*)
+ ;;
+(.[a-zA-Z]:[\\/]*) # OS/2 EMX
+ ;;
+(.\${*prefix}*|.\${*dir}*)
+ eval PKG_CONFIG="$PKG_CONFIG"
+ case ".$PKG_CONFIG" in
+ (.NONE/*)
+ PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;;
+(.no|.NONE/*)
+ PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+(*)
+ { { echo "$as_me:5676: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
{ (exit 1); exit 1; }; }
- ;;
+ ;;
esac
+elif test "x$cf_pkg_config" != xno ; then
+ { echo "$as_me:5683: WARNING: pkg-config is not installed" >&5
+echo "$as_me: WARNING: pkg-config is not installed" >&2;}
fi
-echo "$as_me:4182: checking if you want to see long compiling messages" >&5
+echo "$as_me:5687: checking if you want to see long compiling messages" >&5
echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
enableval="$enable_echo"
test "$enableval" != no && enableval=yes
- if test "$enableval" != "yes" ; then
+ if test "$enableval" != "yes" ; then
- ECHO_LT='--silent'
- ECHO_LD='@echo linking $@;'
- RULE_CC='@echo compiling $<'
- SHOW_CC='@echo compiling $@'
- ECHO_CC='@'
+ ECHO_LT='--silent'
+ ECHO_LD='@echo linking $@;'
+ RULE_CC='@echo compiling $<'
+ SHOW_CC='@echo compiling $@'
+ ECHO_CC='@'
- else
+ else
- ECHO_LT=''
- ECHO_LD=''
- RULE_CC=''
- SHOW_CC=''
- ECHO_CC=''
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC=''
+ SHOW_CC=''
+ ECHO_CC=''
- fi
+ fi
else
enableval=yes
- ECHO_LT=''
- ECHO_LD=''
- RULE_CC=''
- SHOW_CC=''
- ECHO_CC=''
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC=''
+ SHOW_CC=''
+ ECHO_CC=''
fi;
-echo "$as_me:4216: result: $enableval" >&5
+echo "$as_me:5721: result: $enableval" >&5
echo "${ECHO_T}$enableval" >&6
-echo "$as_me:4219: checking for ncurses wrap-prefix" >&5
+echo "$as_me:5724: checking for ncurses wrap-prefix" >&5
echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
@@ -4226,30 +5731,30 @@ if test "${with_ncurses_wrap_prefix+set}" = set; then
else
NCURSES_WRAP_PREFIX=_nc_
fi;
-echo "$as_me:4229: result: $NCURSES_WRAP_PREFIX" >&5
+echo "$as_me:5734: result: $NCURSES_WRAP_PREFIX" >&5
echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
-echo "$as_me:4232: checking if you want to check for wide-character functions" >&5
+echo "$as_me:5737: checking if you want to check for wide-character functions" >&5
echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
# Check whether --enable-widec or --disable-widec was given.
if test "${enable_widec+set}" = set; then
enableval="$enable_widec"
test "$enableval" != no && enableval=yes
- if test "$enableval" != "yes" ; then
+ if test "$enableval" != "yes" ; then
cf_enable_widec=no
- else
- cf_enable_widec=yes
- fi
+ else
+ cf_enable_widec=yes
+ fi
else
enableval=yes
- cf_enable_widec=yes
+ cf_enable_widec=yes
fi;
-echo "$as_me:4249: result: $cf_enable_widec" >&5
+echo "$as_me:5754: result: $cf_enable_widec" >&5
echo "${ECHO_T}$cf_enable_widec" >&6
-echo "$as_me:4252: checking for specific curses-directory" >&5
+echo "$as_me:5757: checking for specific curses-directory" >&5
echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
# Check whether --with-curses-dir or --without-curses-dir was given.
@@ -4259,41 +5764,41 @@ if test "${with_curses_dir+set}" = set; then
else
cf_cv_curses_dir=no
fi;
-echo "$as_me:4262: result: $cf_cv_curses_dir" >&5
+echo "$as_me:5767: result: $cf_cv_curses_dir" >&5
echo "${ECHO_T}$cf_cv_curses_dir" >&6
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
if test "x$prefix" != xNONE; then
- cf_path_syntax="$prefix"
+ cf_path_syntax="$prefix"
else
- cf_path_syntax="$ac_default_prefix"
+ cf_path_syntax="$ac_default_prefix"
fi
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
- ;;
-..|./*|.\\*) #(vi
- ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
- ;;
-.\${*prefix}*|.\${*dir}*) #(vi
- eval withval="$withval"
- case ".$withval" in #(vi
- .NONE/*)
- withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
- ;;
- esac
- ;; #(vi
-.no|.NONE/*)
- withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
- ;;
-*)
- { { echo "$as_me:4293: error: expected a pathname, not \"$withval\"" >&5
+case ".$withval" in
+(.\$\(*\)*|.\'*\'*)
+ ;;
+(..|./*|.\\*)
+ ;;
+(.[a-zA-Z]:[\\/]*) # OS/2 EMX
+ ;;
+(.\${*prefix}*|.\${*dir}*)
+ eval withval="$withval"
+ case ".$withval" in
+ (.NONE/*)
+ withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;;
+(.no|.NONE/*)
+ withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+(*)
+ { { echo "$as_me:5798: error: expected a pathname, not \"$withval\"" >&5
echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
{ (exit 1); exit 1; }; }
- ;;
+ ;;
esac
if test -d "$cf_cv_curses_dir"
@@ -4321,13 +5826,16 @@ if test -n "$cf_cv_curses_dir/include" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 4326 "configure"
+#line 5834 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -4335,16 +5843,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5846: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4341: \$? = $ac_status" >&5
+ echo "$as_me:5849: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4344: \"$ac_try\"") >&5
+ { (eval echo "$as_me:5852: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4347: \$? = $ac_status" >&5
+ echo "$as_me:5855: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -4361,7 +5869,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:4364: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:5872: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -4371,36 +5879,38 @@ echo "${as_me:-configure}:4364: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
fi
if test -n "$cf_cv_curses_dir/lib" ; then
- for cf_add_libdir in $cf_cv_curses_dir/lib
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ for cf_add_libdir in $cf_cv_curses_dir/lib
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:4398: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5908: testing adding $cf_add_libdir to library-path ..." 1>&5
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
fi
fi
@@ -4408,9 +5918,15 @@ fi
cf_cv_screen=curses
-echo "$as_me:4411: checking for specified curses library type" >&5
+echo "$as_me:5921: checking for specified curses library type" >&5
echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
+# Check whether --with-screen or --without-screen was given.
+if test "${with_screen+set}" = set; then
+ withval="$with_screen"
+ cf_cv_screen=$withval
+else
+
# Check whether --with-ncursesw or --without-ncursesw was given.
if test "${with_ncursesw+set}" = set; then
withval="$with_ncursesw"
@@ -4444,29 +5960,30 @@ fi;
fi;
fi;
fi;
+fi;
-echo "$as_me:4448: result: $cf_cv_screen" >&5
+echo "$as_me:5965: result: $cf_cv_screen" >&5
echo "${ECHO_T}$cf_cv_screen" >&6
-case $cf_cv_screen in #(vi
-curses|curses_*) #(vi
+case $cf_cv_screen in
+(curses|curses_*)
-echo "$as_me:4454: checking for extra include directories" >&5
+echo "$as_me:5971: checking for extra include directories" >&5
echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
if test "${cf_cv_curses_incdir+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cf_cv_curses_incdir=no
-case $host_os in #(vi
-hpux10.*) #(vi
+case $host_os in
+(hpux10.*)
if test "x$cf_cv_screen" = "xcurses_colr"
then
test -d /usr/include/curses_colr && \
cf_cv_curses_incdir="-I/usr/include/curses_colr"
fi
;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
if test "x$cf_cv_screen" = "xcurses_5lib"
then
test -d /usr/5lib && \
@@ -4477,27 +5994,33 @@ sunos3*|sunos4*)
esac
fi
-echo "$as_me:4480: result: $cf_cv_curses_incdir" >&5
+echo "$as_me:5997: result: $cf_cv_curses_incdir" >&5
echo "${ECHO_T}$cf_cv_curses_incdir" >&6
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+if test "$cf_cv_curses_incdir" != no
+then
-echo "$as_me:4484: checking if we have identified curses headers" >&5
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
+
+fi
+
+echo "$as_me:6007: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cf_cv_ncurses_header=none
-for cf_header in \
- ncurses.h \
- curses.h ncurses/ncurses.h ncurses/curses.h
+for cf_header in \
+ ncurses.h \
+ curses.h ncurses/ncurses.h ncurses/curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 4496 "configure"
+#line 6019 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
-main ()
+main (void)
{
initscr(); tgoto("?", 0,0)
;
@@ -4505,16 +6028,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4508: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6031: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4511: \$? = $ac_status" >&5
+ echo "$as_me:6034: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4514: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6037: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4517: \$? = $ac_status" >&5
+ echo "$as_me:6040: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -4525,11 +6048,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:4528: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:6051: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:4532: error: No curses header-files found" >&5
+ { { echo "$as_me:6055: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -4539,23 +6062,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:4542: checking for $ac_header" >&5
+echo "$as_me:6065: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 4548 "configure"
+#line 6071 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:4552: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:6075: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:4558: \$? = $ac_status" >&5
+ echo "$as_me:6081: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4574,7 +6097,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:4577: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:6100: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -4584,17 +6107,17 @@ EOF
fi
done
-echo "$as_me:4587: checking for terminfo header" >&5
+echo "$as_me:6110: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
;;
-*)
+(*)
cf_term_header=term.h
;;
esac
@@ -4602,14 +6125,14 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 4605 "configure"
+#line 6128 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>
int
-main ()
+main (void)
{
int x = auto_left_margin
;
@@ -4617,16 +6140,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6143: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:4623: \$? = $ac_status" >&5
+ echo "$as_me:6146: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:4626: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6149: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4629: \$? = $ac_status" >&5
+ echo "$as_me:6152: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -4642,13 +6165,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:4645: result: $cf_cv_term_header" >&5
+echo "$as_me:6168: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
-case $cf_cv_term_header in # (vi
-*term.h)
+case $cf_cv_term_header in
+(*term.h)
cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
@@ -4657,15 +6180,15 @@ EOF
;;
esac
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
+case $cf_cv_term_header in
+(ncurses/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
-ncursesw/term.h)
+(ncursesw/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
@@ -4674,7 +6197,7 @@ EOF
;;
esac
-echo "$as_me:4677: checking for ncurses version" >&5
+echo "$as_me:6200: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4700,10 +6223,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:4703: \"$cf_try\"") >&5
+ { (eval echo "$as_me:6226: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:4706: \$? = $ac_status" >&5
+ echo "$as_me:6229: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -4713,12 +6236,12 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 4716 "configure"
+#line 6239 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <stdio.h>
-int main()
+int main(void)
{
FILE *fp = fopen("$cf_tempfile", "w");
#ifdef NCURSES_VERSION
@@ -4738,15 +6261,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:4741: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6264: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4744: \$? = $ac_status" >&5
+ echo "$as_me:6267: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:4746: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6269: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4749: \$? = $ac_status" >&5
+ echo "$as_me:6272: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -4760,21 +6283,21 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:4763: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:6286: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
test "$cf_cv_ncurses_version" = no ||
cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:4770: checking if we have identified curses libraries" >&5
+echo "$as_me:6293: checking if we have identified curses libraries" >&5
echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 4773 "configure"
+#line 6296 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr(); tgoto("?", 0,0)
;
@@ -4782,16 +6305,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4785: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6308: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4788: \$? = $ac_status" >&5
+ echo "$as_me:6311: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4791: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6314: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4794: \$? = $ac_status" >&5
+ echo "$as_me:6317: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -4800,13 +6323,13 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:4803: result: $cf_result" >&5
+echo "$as_me:6326: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test "$cf_result" = no ; then
-case $host_os in #(vi
-freebsd*) #(vi
- echo "$as_me:4809: checking for tgoto in -lmytinfo" >&5
+case $host_os in
+(freebsd*)
+ echo "$as_me:6332: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4814,7 +6337,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4817 "configure"
+#line 6340 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4825,7 +6348,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char tgoto ();
int
-main ()
+main (void)
{
tgoto ();
;
@@ -4833,16 +6356,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4836: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6359: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4839: \$? = $ac_status" >&5
+ echo "$as_me:6362: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4842: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6365: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4845: \$? = $ac_status" >&5
+ echo "$as_me:6368: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -4853,37 +6376,37 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4856: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:6379: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
-cf_add_libs="-lmytinfo"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
fi
- ;;
-hpux10.*) #(vi
+ ;;
+(hpux10.*)
# Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
# next (1998), and xcurses "newer" (2000). There is no header file for
# Hcurses; the subdirectory curses_colr has the headers (curses.h and
# term.h) for cur_colr
if test "x$cf_cv_screen" = "xcurses_colr"
then
- echo "$as_me:4886: checking for initscr in -lcur_colr" >&5
+ echo "$as_me:6409: checking for initscr in -lcur_colr" >&5
echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4891,7 +6414,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcur_colr $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4894 "configure"
+#line 6417 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4902,7 +6425,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char initscr ();
int
-main ()
+main (void)
{
initscr ();
;
@@ -4910,16 +6433,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4913: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6436: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4916: \$? = $ac_status" >&5
+ echo "$as_me:6439: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4919: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6442: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4922: \$? = $ac_status" >&5
+ echo "$as_me:6445: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_cur_colr_initscr=yes
else
@@ -4930,23 +6453,23 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:4933: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:6456: result: $ac_cv_lib_cur_colr_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
if test $ac_cv_lib_cur_colr_initscr = yes; then
-cf_add_libs="-lcur_colr"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -4954,7 +6477,7 @@ LIBS="$cf_add_libs"
else
- echo "$as_me:4957: checking for initscr in -lHcurses" >&5
+ echo "$as_me:6480: checking for initscr in -lHcurses" >&5
echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4962,7 +6485,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lHcurses $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 4965 "configure"
+#line 6488 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -4973,7 +6496,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char initscr ();
int
-main ()
+main (void)
{
initscr ();
;
@@ -4981,16 +6504,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4984: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6507: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:4987: \$? = $ac_status" >&5
+ echo "$as_me:6510: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:4990: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6513: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:4993: \$? = $ac_status" >&5
+ echo "$as_me:6516: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Hcurses_initscr=yes
else
@@ -5001,29 +6524,31 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5004: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:6527: result: $ac_cv_lib_Hcurses_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
if test $ac_cv_lib_Hcurses_initscr = yes; then
# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
-cf_add_libs="-lHcurses"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
- CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
+
ac_cv_func_initscr=yes
fi
@@ -5032,154 +6557,154 @@ fi
fi
;;
-linux*)
+(linux*)
case `arch 2>/dev/null` in
- x86_64)
+ (x86_64)
if test -d /lib64
then
if test -n "/lib64" ; then
- for cf_add_libdir in /lib64
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ for cf_add_libdir in /lib64
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5060: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6585: testing adding $cf_add_libdir to library-path ..." 1>&5
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
fi
else
if test -n "/lib" ; then
- for cf_add_libdir in /lib
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ for cf_add_libdir in /lib
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5089: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6614: testing adding $cf_add_libdir to library-path ..." 1>&5
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
fi
fi
;;
- *)
+ (*)
if test -n "/lib" ; then
- for cf_add_libdir in /lib
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ for cf_add_libdir in /lib
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5120: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6645: testing adding $cf_add_libdir to library-path ..." 1>&5
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
fi
;;
esac
;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
if test "x$cf_cv_screen" = "xcurses_5lib"
then
if test -d /usr/5lib ; then
if test -n "/usr/5lib" ; then
- for cf_add_libdir in /usr/5lib
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ for cf_add_libdir in /usr/5lib
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
-echo "${as_me:-configure}:5155: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:6680: testing adding $cf_add_libdir to library-path ..." 1>&5
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
fi
-cf_add_libs="-lcurses -ltermcap"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
fi
- fi
- ac_cv_func_initscr=yes
- ;;
+ fi
+ ac_cv_func_initscr=yes
+ ;;
esac
if test ".$ac_cv_func_initscr" != .yes ; then
@@ -5196,53 +6721,53 @@ if test ".$ac_cv_func_initscr" != .yes ; then
# because it may be needed to link the test-case for initscr.
if test "x$cf_term_lib" = x
then
- echo "$as_me:5199: checking for tgoto" >&5
+ echo "$as_me:6724: checking for tgoto" >&5
echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
if test "${ac_cv_func_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 5205 "configure"
+#line 6730 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char tgoto (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define tgoto autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef tgoto
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char tgoto ();
-char (*f) ();
+char tgoto (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_tgoto) || defined (__stub___tgoto)
-choke me
-#else
-f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for tgoto
#endif
+ return tgoto ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5236: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6761: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5239: \$? = $ac_status" >&5
+ echo "$as_me:6764: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5242: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6767: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5245: \$? = $ac_status" >&5
+ echo "$as_me:6770: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_tgoto=yes
else
@@ -5252,7 +6777,7 @@ ac_cv_func_tgoto=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:5255: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:6780: result: $ac_cv_func_tgoto" >&5
echo "${ECHO_T}$ac_cv_func_tgoto" >&6
if test $ac_cv_func_tgoto = yes; then
cf_term_lib=predefined
@@ -5261,7 +6786,7 @@ else
for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
do
as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
-echo "$as_me:5264: checking for tgoto in -l$cf_term_lib" >&5
+echo "$as_me:6789: checking for tgoto in -l$cf_term_lib" >&5
echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5269,7 +6794,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-l$cf_term_lib $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 5272 "configure"
+#line 6797 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5280,7 +6805,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char tgoto ();
int
-main ()
+main (void)
{
tgoto ();
;
@@ -5288,16 +6813,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5291: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6816: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5294: \$? = $ac_status" >&5
+ echo "$as_me:6819: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5297: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6822: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5300: \$? = $ac_status" >&5
+ echo "$as_me:6825: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -5308,10 +6833,13 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:5311: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:6836: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- break
+
+ : ${cf_nculib_root:=$cf_term_lib}
+ break
+
fi
done
@@ -5326,76 +6854,85 @@ fi
then
for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
do
- as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
-echo "$as_me:5330: checking for initscr in -l$cf_curs_lib" >&5
-echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Lib+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$cf_curs_lib $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 5338 "configure"
+ LIBS="-l$cf_curs_lib $cf_save_LIBS"
+ if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
+ echo "$as_me:6859: checking if we can link with $cf_curs_lib library" >&5
+echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6862 "configure"
#include "confdefs.h"
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char initscr ();
+#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
-initscr ();
+initscr()
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6874: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5360: \$? = $ac_status" >&5
+ echo "$as_me:6877: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5363: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6880: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5366: \$? = $ac_status" >&5
+ echo "$as_me:6883: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "$as_ac_Lib=yes"
+ cf_result=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-eval "$as_ac_Lib=no"
+cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:5377: result: `eval echo '${'$as_ac_Lib'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- break
-fi
-
- done
- fi
- test $cf_curs_lib = unknown && { { echo "$as_me:5385: error: no curses library found" >&5
-echo "$as_me: error: no curses library found" >&2;}
- { (exit 1); exit 1; }; }
+ echo "$as_me:6892: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+ test $cf_result = yes && break
+ elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+ cf_result=no
+ elif test "$cf_term_lib" != predefined ; then
+ echo "$as_me:6898: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6901 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main (void)
+{
+initscr(); tgoto((char *)0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6913: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:6916: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:6919: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:6922: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
- LIBS="-l$cf_curs_lib $cf_save_LIBS"
- if test "$cf_term_lib" = unknown ; then
- echo "$as_me:5391: checking if we can link with $cf_curs_lib library" >&5
-echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-#line 5394 "configure"
+ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6931 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr()
;
@@ -5403,117 +6940,915 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5406: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6943: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5409: \$? = $ac_status" >&5
+ echo "$as_me:6946: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5412: \"$ac_try\"") >&5
+ { (eval echo "$as_me:6949: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5415: \$? = $ac_status" >&5
+ echo "$as_me:6952: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_result=no
+cf_result=error
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:5424: result: $cf_result" >&5
+ echo "$as_me:6964: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
- test $cf_result = no && { { echo "$as_me:5426: error: Cannot link curses library" >&5
-echo "$as_me: error: Cannot link curses library" >&2;}
+ test $cf_result != error && break
+ fi
+ done
+ fi
+ test $cf_curs_lib = unknown && { { echo "$as_me:6970: error: no curses library found" >&5
+echo "$as_me: error: no curses library found" >&2;}
{ (exit 1); exit 1; }; }
- elif test "$cf_curs_lib" = "$cf_term_lib" ; then
- :
- elif test "$cf_term_lib" != predefined ; then
- echo "$as_me:5432: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
-echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
-#line 5435 "configure"
+fi
+fi
+
+ ;;
+(ncursesw*)
+
+echo "$as_me:6979: checking for multibyte character support" >&5
+echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
+if test "${cf_cv_utf8_lib+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_save_LIBS="$LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6987 "configure"
#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
+
+#include <stdlib.h>
int
-main ()
+main (void)
{
-initscr(); tgoto((char *)0, 0, 0);
+putwc(0,0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5447: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7000: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5450: \$? = $ac_status" >&5
+ echo "$as_me:7003: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5453: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7006: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5456: \$? = $ac_status" >&5
+ echo "$as_me:7009: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_result=no
+ cf_cv_utf8_lib=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
- LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_utf8=
+cf_cv_library_path_utf8=
+
+echo "${as_me:-configure}:7021: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+cf_save_LIBS="$LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7026 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main (void)
+{
+putwc(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7039: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7042: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:7045: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7048: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_find_linkage_utf8=yes
+ cf_cv_header_path_utf8=/usr/include
+ cf_cv_library_path_utf8=/usr/lib
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+LIBS="-lutf8 $cf_save_LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7062 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main (void)
+{
+putwc(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7075: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7078: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:7081: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7084: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_find_linkage_utf8=yes
+ cf_cv_header_path_utf8=/usr/include
+ cf_cv_library_path_utf8=/usr/lib
+ cf_cv_library_file_utf8="-lutf8"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_find_linkage_utf8=no
+ LIBS="$cf_save_LIBS"
+
+ test -n "$verbose" && echo " find linkage for utf8 library" 1>&6
+
+echo "${as_me:-configure}:7101: testing find linkage for utf8 library ..." 1>&5
+
+echo "${as_me:-configure}:7103: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_test_CPPFLAGS="$CPPFLAGS"
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+ for cf_header_path in $CPPFLAGS $CFLAGS
+ do
+ case $cf_header_path in
+ (-I*)
+ cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "x$cf_header_path" != "xNONE" && \
+test -d "$cf_header_path" && \
+ {
+ test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
+ test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include"
+ test -d $cf_header_path/include/utf8 && cf_search="$cf_search $cf_header_path/include/utf8"
+ test -d $cf_header_path/include/utf8/include && cf_search="$cf_search $cf_header_path/include/utf8/include"
+ test -d $cf_header_path/utf8/include && cf_search="$cf_search $cf_header_path/utf8/include"
+ test -d $cf_header_path/utf8/include/utf8 && cf_search="$cf_search $cf_header_path/utf8/include/utf8"
+}
+
+ cf_header_path_list="$cf_header_path_list $cf_search"
+ ;;
+ esac
+ done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "x$prefix" != "xNONE" && \
+test -d "$prefix" && \
+ {
+ test -n "$verbose" && echo " ... testing for include-directories under $prefix"
+ test -d $prefix/include && cf_search="$cf_search $prefix/include"
+ test -d $prefix/include/utf8 && cf_search="$cf_search $prefix/include/utf8"
+ test -d $prefix/include/utf8/include && cf_search="$cf_search $prefix/include/utf8/include"
+ test -d $prefix/utf8/include && cf_search="$cf_search $prefix/utf8/include"
+ test -d $prefix/utf8/include/utf8 && cf_search="$cf_search $prefix/utf8/include/utf8"
+}
+
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
+
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include"
+ test -d $cf_subdir_prefix/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/include/utf8"
+ test -d $cf_subdir_prefix/include/utf8/include && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
+ test -d $cf_subdir_prefix/utf8/include && cf_search="$cf_search $cf_subdir_prefix/utf8/include"
+ test -d $cf_subdir_prefix/utf8/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
+}
+
+done
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+ test -d $includedir && cf_search="$cf_search $includedir"
+ test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+ test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
+ test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+ for cf_cv_header_path_utf8 in $cf_search
+ do
+ if test -d $cf_cv_header_path_utf8 ; then
+ test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7194: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+
+ CPPFLAGS="$cf_save_CPPFLAGS"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 5465 "configure"
+#line 7202 "configure"
#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
+
+#include <libutf8.h>
int
-main ()
+main (void)
{
-initscr()
+putwc(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7215: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7218: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7221: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7224: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7229: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+
+ cf_cv_find_linkage_utf8=maybe
+ cf_test_CPPFLAGS="$CPPFLAGS"
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ done
+
+ if test "$cf_cv_find_linkage_utf8" = maybe ; then
+
+echo "${as_me:-configure}:7247: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+
+ cf_save_LIBS="$LIBS"
+ cf_save_LDFLAGS="$LDFLAGS"
+
+ if test "$cf_cv_find_linkage_utf8" != yes ; then
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+ for cf_library_path in $LDFLAGS $LIBS
+ do
+ case $cf_library_path in
+ (-L*)
+ cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "x$cf_library_path" != "xNONE" && \
+test -d "$cf_library_path" && \
+ {
+ test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
+ test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib"
+ test -d $cf_library_path/lib/utf8 && cf_search="$cf_search $cf_library_path/lib/utf8"
+ test -d $cf_library_path/lib/utf8/lib && cf_search="$cf_search $cf_library_path/lib/utf8/lib"
+ test -d $cf_library_path/utf8/lib && cf_search="$cf_search $cf_library_path/utf8/lib"
+ test -d $cf_library_path/utf8/lib/utf8 && cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
+}
+
+ cf_library_path_list="$cf_library_path_list $cf_search"
+ ;;
+ esac
+ done
+fi
+
+cf_search=
+
+test "x$prefix" != "xNONE" && \
+test -d "$prefix" && \
+ {
+ test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
+ test -d $prefix/lib && cf_search="$cf_search $prefix/lib"
+ test -d $prefix/lib/utf8 && cf_search="$cf_search $prefix/lib/utf8"
+ test -d $prefix/lib/utf8/lib && cf_search="$cf_search $prefix/lib/utf8/lib"
+ test -d $prefix/utf8/lib && cf_search="$cf_search $prefix/utf8/lib"
+ test -d $prefix/utf8/lib/utf8 && cf_search="$cf_search $prefix/utf8/lib/utf8"
+}
+
+for cf_subdir_prefix in \
+ /usr \
+ /usr/local \
+ /usr/pkg \
+ /opt \
+ /opt/local \
+ $HOME
+do
+
+test "x$cf_subdir_prefix" != "x$prefix" && \
+test -d "$cf_subdir_prefix" && \
+(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
+ test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
+ test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib"
+ test -d $cf_subdir_prefix/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
+ test -d $cf_subdir_prefix/lib/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
+ test -d $cf_subdir_prefix/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
+ test -d $cf_subdir_prefix/utf8/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
+}
+
+done
+
+cf_search="$cf_library_path_list $cf_search"
+
+ for cf_cv_library_path_utf8 in $cf_search
+ do
+ if test -d $cf_cv_library_path_utf8 ; then
+ test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7322: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+
+ CPPFLAGS="$cf_test_CPPFLAGS"
+ LIBS="-lutf8 $cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7328 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main (void)
+{
+putwc(0,0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5477: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:5480: \$? = $ac_status" >&5
+ echo "$as_me:7344: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:5483: \"$ac_try\"") >&5
+ { (eval echo "$as_me:7347: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5486: \$? = $ac_status" >&5
+ echo "$as_me:7350: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_result=yes
+
+ test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7355: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+
+ cf_cv_find_linkage_utf8=yes
+ cf_cv_library_file_utf8="-lutf8"
+ break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_result=error
+
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ done
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LDFLAGS="$cf_save_LDFLAGS"
+ fi
+
+ else
+ cf_cv_find_linkage_utf8=no
+ fi
+
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:5498: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
- fi
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_utf8" = yes ; then
+cf_cv_utf8_lib=add-on
+else
+cf_cv_utf8_lib=no
+fi
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:7397: result: $cf_cv_utf8_lib" >&5
+echo "${ECHO_T}$cf_cv_utf8_lib" >&6
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
+
+if test -n "$cf_cv_header_path_utf8" ; then
+ for cf_add_incdir in $cf_cv_header_path_utf8
+ do
+ while test $cf_add_incdir != /usr/include
+ do
+ if test -d $cf_add_incdir
+ then
+ cf_have_incdir=no
+ if test -n "$CFLAGS$CPPFLAGS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+ if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+ cf_have_incdir=yes; break
+ fi
+ done
+ fi
+
+ if test "$cf_have_incdir" = no ; then
+ if test "$cf_add_incdir" = /usr/local/include ; then
+ if test "$GCC" = yes
+ then
+ cf_save_CPPFLAGS=$CPPFLAGS
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7435 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main (void)
+{
+printf("Hello")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7447: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7450: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7453: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7456: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS=$cf_save_CPPFLAGS
+ fi
+ fi
+ fi
+
+ if test "$cf_have_incdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:7473: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+ test "$cf_top_incdir" = "$cf_add_incdir" && break
+ cf_add_incdir="$cf_top_incdir"
+ else
+ break
+ fi
+ else
+ break
+ fi
+ done
+ done
+fi
+
+if test -n "$cf_cv_library_path_utf8" ; then
+ for cf_add_libdir in $cf_cv_library_path_utf8
+ do
+ if test $cf_add_libdir = /usr/lib ; then
+ :
+ elif test -d $cf_add_libdir
+ then
+ cf_have_libdir=no
+ if test -n "$LDFLAGS$LIBS" ; then
+ # a loop is needed to ensure we can add subdirs of existing dirs
+ for cf_test_libdir in $LDFLAGS $LIBS ; do
+ if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+ cf_have_libdir=yes; break
+ fi
+ done
+ fi
+ if test "$cf_have_libdir" = no ; then
+ test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:7509: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+ LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+ fi
+ fi
+ done
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+fi
+
+cf_ncuconfig_root=$cf_cv_screen
+cf_have_ncuconfig=no
+
+if test "x${PKG_CONFIG:=none}" != xnone; then
+ echo "$as_me:7539: checking pkg-config for $cf_ncuconfig_root" >&5
+echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
+ if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
+ echo "$as_me:7542: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+ echo "$as_me:7545: checking if the $cf_ncuconfig_root package files work" >&5
+echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
+ cf_have_ncuconfig=unknown
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7667 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main (void)
+{
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7679: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7682: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:7685: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7688: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ if test "$cross_compiling" = yes; then
+ cf_have_ncuconfig=maybe
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7694 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+ int main(void)
+ { char *xx = curses_version(); return (xx == 0); }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:7701: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7704: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:7706: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7709: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_have_ncuconfig=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_ncuconfig=no
fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_ncuconfig=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ echo "$as_me:7726: result: $cf_have_ncuconfig" >&5
+echo "${ECHO_T}$cf_have_ncuconfig" >&6
+ test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
+ if test "$cf_have_ncuconfig" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ NCURSES_CONFIG_PKG=none
+ else
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+ NCURSES_CONFIG_PKG=$cf_ncuconfig_root
+
+echo "$as_me:7742: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
+ cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+ ;;
+(*)
+ cf_term_header=term.h
;;
-ncurses) #(vi
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 7760 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
-cf_ncuconfig_root=ncurses
+int
+main (void)
+{
+int x = auto_left_margin
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7775: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7778: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7781: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7784: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_term_header="$cf_test"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:7800: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
-echo "Looking for ${cf_ncuconfig_root}-config"
+case $cf_cv_term_header in
+(*term.h)
+
+cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+ ;;
+esac
+
+case $cf_cv_term_header in
+(ncurses/term.h)
+
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+ ;;
+(ncursesw/term.h)
+
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+ ;;
+esac
+
+ fi
+
+ else
+ echo "$as_me:7835: result: no" >&5
+echo "${ECHO_T}no" >&6
+ NCURSES_CONFIG_PKG=none
+ fi
+else
+ NCURSES_CONFIG_PKG=none
+fi
+
+if test "x$cf_have_ncuconfig" = "xno"; then
+ cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
if test -n "$ac_tool_prefix"; then
- for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:5516: checking for $ac_word" >&5
+echo "$as_me:7851: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5528,7 +7863,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:5531: found $ac_dir/$ac_word" >&5
+echo "$as_me:7866: found $ac_dir/$ac_word" >&5
break
done
@@ -5536,10 +7871,10 @@ fi
fi
NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
if test -n "$NCURSES_CONFIG"; then
- echo "$as_me:5539: result: $NCURSES_CONFIG" >&5
+ echo "$as_me:7874: result: $NCURSES_CONFIG" >&5
echo "${ECHO_T}$NCURSES_CONFIG" >&6
else
- echo "$as_me:5542: result: no" >&5
+ echo "$as_me:7877: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -5548,11 +7883,11 @@ fi
fi
if test -z "$NCURSES_CONFIG"; then
ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
- for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:5555: checking for $ac_word" >&5
+echo "$as_me:7890: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5567,7 +7902,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
-echo "$as_me:5570: found $ac_dir/$ac_word" >&5
+echo "$as_me:7905: found $ac_dir/$ac_word" >&5
break
done
@@ -5575,10 +7910,10 @@ fi
fi
ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
if test -n "$ac_ct_NCURSES_CONFIG"; then
- echo "$as_me:5578: result: $ac_ct_NCURSES_CONFIG" >&5
+ echo "$as_me:7913: result: $ac_ct_NCURSES_CONFIG" >&5
echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
else
- echo "$as_me:5581: result: no" >&5
+ echo "$as_me:7916: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -5589,47 +7924,141 @@ test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
fi
-if test "$NCURSES_CONFIG" != none ; then
+ if test "$NCURSES_CONFIG" != none ; then
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
-cf_add_libs="`$NCURSES_CONFIG --libs`"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+for cf_add_cflags in `$NCURSES_CONFIG --cflags`
do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
-# even with config script, some packages use no-override for curses.h
+ # even with config script, some packages use no-override for curses.h
-echo "$as_me:5614: checking if we have identified curses headers" >&5
+echo "$as_me:8045: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cf_cv_ncurses_header=none
-for cf_header in \
- ncurses/ncurses.h \
- ncurses/curses.h \
- ncurses.h \
- curses.h
+for cf_header in \
+ ncurses.h $cf_cv_screen/ncurses.h \
+ curses.h $cf_cv_screen/curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 5628 "configure"
+#line 8057 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
-main ()
+main (void)
{
initscr(); tgoto("?", 0,0)
;
@@ -5637,16 +8066,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5640: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8069: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:5643: \$? = $ac_status" >&5
+ echo "$as_me:8072: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5646: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8075: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5649: \$? = $ac_status" >&5
+ echo "$as_me:8078: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -5657,11 +8086,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:5660: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:8089: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:5664: error: No curses header-files found" >&5
+ { { echo "$as_me:8093: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -5671,23 +8100,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:5674: checking for $ac_header" >&5
+echo "$as_me:8103: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 5680 "configure"
+#line 8109 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:5684: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:8113: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:5690: \$? = $ac_status" >&5
+ echo "$as_me:8119: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5706,7 +8135,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:5709: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:8138: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -5722,15 +8151,15 @@ EOF
cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<EOF
#define $cf_nculib_ROOT 1
EOF
-cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+ cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
-else
+ else
-cf_ncuhdr_root=ncurses
+cf_ncuhdr_root=$cf_cv_screen
test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && { \
@@ -5757,13 +8186,16 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 5762 "configure"
+#line 8194 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -5771,16 +8203,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8206: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:5777: \$? = $ac_status" >&5
+ echo "$as_me:8209: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5780: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8212: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5783: \$? = $ac_status" >&5
+ echo "$as_me:8215: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -5797,7 +8229,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:5800: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8232: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -5807,6 +8239,8 @@ echo "${as_me:-configure}:5800: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -5814,7 +8248,7 @@ fi
}
-echo "$as_me:5817: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:8251: checking for $cf_ncuhdr_root header in include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5826,12 +8260,12 @@ else
do
cat >conftest.$ac_ext <<_ACEOF
-#line 5829 "configure"
+#line 8263 "configure"
#include "confdefs.h"
#include <$cf_header>
int
-main ()
+main (void)
{
#ifdef NCURSES_VERSION
@@ -5850,16 +8284,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5853: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8287: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:5856: \$? = $ac_status" >&5
+ echo "$as_me:8290: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:5859: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8293: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:5862: \$? = $ac_status" >&5
+ echo "$as_me:8296: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h=$cf_header
@@ -5874,14 +8308,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:5877: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:8311: result: $cf_cv_ncurses_h" >&5
echo "${ECHO_T}$cf_cv_ncurses_h" >&6
if test "$cf_cv_ncurses_h" != no ; then
cf_cv_ncurses_header=$cf_cv_ncurses_h
else
-echo "$as_me:5884: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:8318: checking for $cf_ncuhdr_root include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h2+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5896,8 +8330,8 @@ cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
for cf_header_path in $CPPFLAGS $CFLAGS
do
- case $cf_header_path in #(vi
- -I*)
+ case $cf_header_path in
+ (-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
test "x$cf_header_path" != "xNONE" && \
@@ -5997,13 +8431,16 @@ if test -n "$cf_incdir" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 6002 "configure"
+#line 8439 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -6011,16 +8448,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6014: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8451: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6017: \$? = $ac_status" >&5
+ echo "$as_me:8454: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6020: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8457: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6023: \$? = $ac_status" >&5
+ echo "$as_me:8460: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -6037,7 +8474,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:6040: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8477: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -6047,6 +8484,8 @@ echo "${as_me:-configure}:6040: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -6058,12 +8497,12 @@ fi
do
cat >conftest.$ac_ext <<_ACEOF
-#line 6061 "configure"
+#line 8500 "configure"
#include "confdefs.h"
#include <$cf_header>
int
-main ()
+main (void)
{
#ifdef NCURSES_VERSION
@@ -6082,16 +8521,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6085: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8524: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6088: \$? = $ac_status" >&5
+ echo "$as_me:8527: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6091: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8530: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6094: \$? = $ac_status" >&5
+ echo "$as_me:8533: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h2=$cf_header
@@ -6112,12 +8551,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save2_CPPFLAGS"
test "$cf_cv_ncurses_h2" != no && break
done
- test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6115: error: not found" >&5
+ test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8554: error: not found" >&5
echo "$as_me: error: not found" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:6120: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:8559: result: $cf_cv_ncurses_h2" >&5
echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -6148,13 +8587,16 @@ if test -n "$cf_1st_incdir" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 6153 "configure"
+#line 8595 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -6162,16 +8604,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6165: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8607: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6168: \$? = $ac_status" >&5
+ echo "$as_me:8610: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6171: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8613: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6174: \$? = $ac_status" >&5
+ echo "$as_me:8616: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -6188,7 +8630,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:6191: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8633: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -6198,6 +8640,8 @@ echo "${as_me:-configure}:6191: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -6207,8 +8651,8 @@ fi
# Set definitions to allow ifdef'ing for ncurses.h
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
+case $cf_cv_ncurses_header in
+(*ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_H 1
@@ -6217,15 +8661,15 @@ EOF
;;
esac
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
+case $cf_cv_ncurses_header in
+(ncurses/curses.h|ncurses/ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF
;;
-ncursesw/curses.h|ncursesw/ncurses.h)
+(ncursesw/curses.h|ncursesw/ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
@@ -6234,17 +8678,17 @@ EOF
;;
esac
-echo "$as_me:6237: checking for terminfo header" >&5
+echo "$as_me:8681: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
;;
-*)
+(*)
cf_term_header=term.h
;;
esac
@@ -6252,14 +8696,14 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 6255 "configure"
+#line 8699 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>
int
-main ()
+main (void)
{
int x = auto_left_margin
;
@@ -6267,16 +8711,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6270: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:6273: \$? = $ac_status" >&5
+ echo "$as_me:8717: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:6276: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8720: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6279: \$? = $ac_status" >&5
+ echo "$as_me:8723: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -6292,13 +8736,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:6295: result: $cf_cv_term_header" >&5
+echo "$as_me:8739: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
-case $cf_cv_term_header in # (vi
-*term.h)
+case $cf_cv_term_header in
+(*term.h)
cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
@@ -6307,15 +8751,15 @@ EOF
;;
esac
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
+case $cf_cv_term_header in
+(ncurses/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
-ncursesw/term.h)
+(ncursesw/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
@@ -6330,7 +8774,7 @@ cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:6333: checking for ncurses version" >&5
+echo "$as_me:8777: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6356,10 +8800,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:6359: \"$cf_try\"") >&5
+ { (eval echo "$as_me:8803: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:6362: \$? = $ac_status" >&5
+ echo "$as_me:8806: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -6369,12 +8813,12 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 6372 "configure"
+#line 8816 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <stdio.h>
-int main()
+int main(void)
{
FILE *fp = fopen("$cf_tempfile", "w");
#ifdef NCURSES_VERSION
@@ -6394,15 +8838,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6397: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8841: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6400: \$? = $ac_status" >&5
+ echo "$as_me:8844: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:6402: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8846: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6405: \$? = $ac_status" >&5
+ echo "$as_me:8849: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6416,20 +8860,20 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:6419: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:8863: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
test "$cf_cv_ncurses_version" = no ||
cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-cf_nculib_root=ncurses
+cf_nculib_root=$cf_cv_screen
# This works, except for the special case where we find gpm, but
# ncurses is in a nonstandard location via $LIBS, and we really want
# to link gpm.
cf_ncurses_LIBS=""
cf_ncurses_SAVE="$LIBS"
-echo "$as_me:6432: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:8876: checking for Gpm_Open in -lgpm" >&5
echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6437,7 +8881,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6440 "configure"
+#line 8884 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6448,7 +8892,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char Gpm_Open ();
int
-main ()
+main (void)
{
Gpm_Open ();
;
@@ -6456,16 +8900,16 @@ Gpm_Open ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6459: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8903: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6462: \$? = $ac_status" >&5
+ echo "$as_me:8906: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6465: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8909: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6468: \$? = $ac_status" >&5
+ echo "$as_me:8912: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_Gpm_Open=yes
else
@@ -6476,10 +8920,10 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6479: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:8923: result: $ac_cv_lib_gpm_Gpm_Open" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
if test $ac_cv_lib_gpm_Gpm_Open = yes; then
- echo "$as_me:6482: checking for initscr in -lgpm" >&5
+ echo "$as_me:8926: checking for initscr in -lgpm" >&5
echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6487,7 +8931,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6490 "configure"
+#line 8934 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6498,7 +8942,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char initscr ();
int
-main ()
+main (void)
{
initscr ();
;
@@ -6506,16 +8950,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6509: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8953: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6512: \$? = $ac_status" >&5
+ echo "$as_me:8956: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6515: \"$ac_try\"") >&5
+ { (eval echo "$as_me:8959: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6518: \$? = $ac_status" >&5
+ echo "$as_me:8962: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_initscr=yes
else
@@ -6526,7 +8970,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6529: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:8973: result: $ac_cv_lib_gpm_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
if test $ac_cv_lib_gpm_initscr = yes; then
LIBS="$cf_ncurses_SAVE"
@@ -6536,12 +8980,12 @@ fi
fi
-case $host_os in #(vi
-freebsd*)
+case $host_os in
+(freebsd*)
# This is only necessary if you are linking against an obsolete
# version of ncurses (but it should do no harm, since it's static).
if test "$cf_nculib_root" = ncurses ; then
- echo "$as_me:6544: checking for tgoto in -lmytinfo" >&5
+ echo "$as_me:8988: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6549,7 +8993,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6552 "configure"
+#line 8996 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -6560,7 +9004,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char tgoto ();
int
-main ()
+main (void)
{
tgoto ();
;
@@ -6568,16 +9012,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6571: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9015: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6574: \$? = $ac_status" >&5
+ echo "$as_me:9018: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6577: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9021: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6580: \$? = $ac_status" >&5
+ echo "$as_me:9024: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -6588,7 +9032,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:6591: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:9035: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -6598,38 +9042,38 @@ fi
;;
esac
-cf_add_libs="$cf_ncurses_LIBS"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
-cf_add_libs="-l$cf_nculib_root"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -6637,53 +9081,53 @@ else
eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
cf_libdir=""
- echo "$as_me:6640: checking for initscr" >&5
+ echo "$as_me:9084: checking for initscr" >&5
echo $ECHO_N "checking for initscr... $ECHO_C" >&6
if test "${ac_cv_func_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 6646 "configure"
+#line 9090 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char initscr (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define initscr autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef initscr
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char initscr ();
-char (*f) ();
+char initscr (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_initscr) || defined (__stub___initscr)
-choke me
-#else
-f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for initscr
#endif
+ return initscr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6677: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9121: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6680: \$? = $ac_status" >&5
+ echo "$as_me:9124: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6683: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9127: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6686: \$? = $ac_status" >&5
+ echo "$as_me:9130: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_initscr=yes
else
@@ -6693,22 +9137,22 @@ ac_cv_func_initscr=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:6696: result: $ac_cv_func_initscr" >&5
+echo "$as_me:9140: result: $ac_cv_func_initscr" >&5
echo "${ECHO_T}$ac_cv_func_initscr" >&6
if test $ac_cv_func_initscr = yes; then
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
cf_save_LIBS="$LIBS"
- echo "$as_me:6703: checking for initscr in -l$cf_nculib_root" >&5
+ echo "$as_me:9147: checking for initscr in -l$cf_nculib_root" >&5
echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
LIBS="-l$cf_nculib_root $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6707 "configure"
+#line 9151 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr()
;
@@ -6716,25 +9160,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6719: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6722: \$? = $ac_status" >&5
+ echo "$as_me:9166: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6725: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9169: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6728: \$? = $ac_status" >&5
+ echo "$as_me:9172: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:6730: result: yes" >&5
+ echo "$as_me:9174: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:6737: result: no" >&5
+echo "$as_me:9181: result: no" >&5
echo "${ECHO_T}no" >&6
cf_search=
@@ -6742,8 +9186,8 @@ cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
for cf_library_path in $LDFLAGS $LIBS
do
- case $cf_library_path in #(vi
- -L*)
+ case $cf_library_path in
+ (-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
test "x$cf_library_path" != "xNONE" && \
@@ -6802,15 +9246,15 @@ cf_search="$cf_library_path_list $cf_search"
for cf_libdir in $cf_search
do
- echo "$as_me:6805: checking for -l$cf_nculib_root in $cf_libdir" >&5
+ echo "$as_me:9249: checking for -l$cf_nculib_root in $cf_libdir" >&5
echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 6809 "configure"
+#line 9253 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr()
;
@@ -6818,25 +9262,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6821: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9265: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6824: \$? = $ac_status" >&5
+ echo "$as_me:9268: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6827: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9271: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6830: \$? = $ac_status" >&5
+ echo "$as_me:9274: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:6832: result: yes" >&5
+ echo "$as_me:9276: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:6839: result: no" >&5
+echo "$as_me:9283: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_save_LIBS"
fi
@@ -6851,7 +9295,7 @@ fi
eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
if test $cf_found_library = no ; then
- { { echo "$as_me:6854: error: Cannot link $cf_nculib_root library" >&5
+ { { echo "$as_me:9298: error: Cannot link $cf_nculib_root library" >&5
echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -6859,7 +9303,7 @@ fi
fi
if test -n "$cf_ncurses_LIBS" ; then
- echo "$as_me:6862: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+ echo "$as_me:9306: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
cf_ncurses_SAVE="$LIBS"
for p in $cf_ncurses_LIBS ; do
@@ -6869,11 +9313,11 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
fi
done
cat >conftest.$ac_ext <<_ACEOF
-#line 6872 "configure"
+#line 9316 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
;
@@ -6881,23 +9325,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6884: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9328: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:6887: \$? = $ac_status" >&5
+ echo "$as_me:9331: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6890: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9334: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:6893: \$? = $ac_status" >&5
+ echo "$as_me:9337: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:6895: result: yes" >&5
+ echo "$as_me:9339: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:6900: result: no" >&5
+echo "$as_me:9344: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_ncurses_SAVE"
fi
@@ -6910,568 +9354,331 @@ cat >>confdefs.h <<EOF
#define $cf_nculib_ROOT 1
EOF
+ fi
+else
+ NCURSES_CONFIG=none
fi
;;
-ncursesw) #(vi
+(ncurses*)
-echo "$as_me:6918: checking for multibyte character support" >&5
-echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
-if test "${cf_cv_utf8_lib+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+cf_ncuconfig_root=$cf_cv_screen
+cf_have_ncuconfig=no
- cf_save_LIBS="$LIBS"
- cat >conftest.$ac_ext <<_ACEOF
-#line 6926 "configure"
-#include "confdefs.h"
-
-#include <stdlib.h>
-int
-main ()
-{
-putwc(0,0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6939: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:6942: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6945: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:6948: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_cv_utf8_lib=yes
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-
-# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
-# will be set on completion of the AC_TRY_LINK below.
-cf_cv_header_path_utf8=
-cf_cv_library_path_utf8=
-
-echo "${as_me:-configure}:6960: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
-
-cf_save_LIBS="$LIBS"
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 6965 "configure"
-#include "confdefs.h"
-
-#include <libutf8.h>
-int
-main ()
-{
-putwc(0,0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6978: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:6981: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:6984: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:6987: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
- cf_cv_find_linkage_utf8=yes
- cf_cv_header_path_utf8=/usr/include
- cf_cv_library_path_utf8=/usr/lib
-
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+if test "x${PKG_CONFIG:=none}" != xnone; then
+ echo "$as_me:9369: checking pkg-config for $cf_ncuconfig_root" >&5
+echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
+ if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
+ echo "$as_me:9372: result: yes" >&5
+echo "${ECHO_T}yes" >&6
-LIBS="-lutf8 $cf_save_LIBS"
+ echo "$as_me:9375: checking if the $cf_ncuconfig_root package files work" >&5
+echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
+ cf_have_ncuconfig=unknown
-cat >conftest.$ac_ext <<_ACEOF
-#line 7001 "configure"
-#include "confdefs.h"
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
-#include <libutf8.h>
-int
-main ()
-{
-putwc(0,0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7014: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:7017: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7020: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:7023: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
- cf_cv_find_linkage_utf8=yes
- cf_cv_header_path_utf8=/usr/include
- cf_cv_library_path_utf8=/usr/lib
- cf_cv_library_file_utf8="-lutf8"
+for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
- cf_cv_find_linkage_utf8=no
- LIBS="$cf_save_LIBS"
+ if test $cf_fix_cppflags = yes ; then
- test -n "$verbose" && echo " find linkage for utf8 library" 1>&6
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
-echo "${as_me:-configure}:7040: testing find linkage for utf8 library ..." 1>&5
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
-echo "${as_me:-configure}:7042: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
- cf_save_CPPFLAGS="$CPPFLAGS"
- cf_test_CPPFLAGS="$CPPFLAGS"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
-cf_search=
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
-# collect the current set of include-directories from compiler flags
-cf_header_path_list=""
-if test -n "${CFLAGS}${CPPFLAGS}" ; then
- for cf_header_path in $CPPFLAGS $CFLAGS
- do
- case $cf_header_path in #(vi
- -I*)
- cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+ ;;
+ esac
-test "x$cf_header_path" != "xNONE" && \
-test -d "$cf_header_path" && \
- {
- test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path"
- test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include"
- test -d $cf_header_path/include/utf8 && cf_search="$cf_search $cf_header_path/include/utf8"
- test -d $cf_header_path/include/utf8/include && cf_search="$cf_search $cf_header_path/include/utf8/include"
- test -d $cf_header_path/utf8/include && cf_search="$cf_search $cf_header_path/utf8/include"
- test -d $cf_header_path/utf8/include/utf8 && cf_search="$cf_search $cf_header_path/utf8/include/utf8"
-}
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
- cf_header_path_list="$cf_header_path_list $cf_search"
;;
esac
- done
-fi
+ ;;
+ (*)
-# add the variations for the package we are looking for
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
-cf_search=
+ ;;
+ esac
+ ;;
+(yes)
-test "x$prefix" != "xNONE" && \
-test -d "$prefix" && \
- {
- test -n "$verbose" && echo " ... testing for include-directories under $prefix"
- test -d $prefix/include && cf_search="$cf_search $prefix/include"
- test -d $prefix/include/utf8 && cf_search="$cf_search $prefix/include/utf8"
- test -d $prefix/include/utf8/include && cf_search="$cf_search $prefix/include/utf8/include"
- test -d $prefix/utf8/include && cf_search="$cf_search $prefix/utf8/include"
- test -d $prefix/utf8/include/utf8 && cf_search="$cf_search $prefix/utf8/include/utf8"
-}
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
-for cf_subdir_prefix in \
- /usr \
- /usr/local \
- /usr/pkg \
- /opt \
- /opt/local \
- $HOME
-do
-
-test "x$cf_subdir_prefix" != "x$prefix" && \
-test -d "$cf_subdir_prefix" && \
-(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
- test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix"
- test -d $cf_subdir_prefix/include && cf_search="$cf_search $cf_subdir_prefix/include"
- test -d $cf_subdir_prefix/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/include/utf8"
- test -d $cf_subdir_prefix/include/utf8/include && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
- test -d $cf_subdir_prefix/utf8/include && cf_search="$cf_search $cf_subdir_prefix/utf8/include"
- test -d $cf_subdir_prefix/utf8/include/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
-}
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
done
-test "$includedir" != NONE && \
-test "$includedir" != "/usr/include" && \
-test -d "$includedir" && {
- test -d $includedir && cf_search="$cf_search $includedir"
- test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
-}
-
-test "$oldincludedir" != NONE && \
-test "$oldincludedir" != "/usr/include" && \
-test -d "$oldincludedir" && {
- test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
- test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
-}
-
-cf_search="$cf_search $cf_header_path_list"
-
- for cf_cv_header_path_utf8 in $cf_search
- do
- if test -d $cf_cv_header_path_utf8 ; then
- test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6
-
-echo "${as_me:-configure}:7133: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
-
- CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
- cat >conftest.$ac_ext <<_ACEOF
-#line 7137 "configure"
-#include "confdefs.h"
-
-#include <libutf8.h>
-int
-main ()
-{
-putwc(0,0);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7150: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:7153: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7156: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:7159: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
-
- test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
-
-echo "${as_me:-configure}:7164: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
-
- cf_cv_find_linkage_utf8=maybe
- cf_test_CPPFLAGS="$CPPFLAGS"
- break
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
+if test -n "$cf_new_cflags" ; then
- CPPFLAGS="$cf_save_CPPFLAGS"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- fi
- done
-
- if test "$cf_cv_find_linkage_utf8" = maybe ; then
-
-echo "${as_me:-configure}:7182: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
- cf_save_LIBS="$LIBS"
- cf_save_LDFLAGS="$LDFLAGS"
-
- if test "$cf_cv_find_linkage_utf8" != yes ; then
-
-cf_search=
-cf_library_path_list=""
-if test -n "${LDFLAGS}${LIBS}" ; then
- for cf_library_path in $LDFLAGS $LIBS
- do
- case $cf_library_path in #(vi
- -L*)
- cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+if test -n "$cf_new_cppflags" ; then
-test "x$cf_library_path" != "xNONE" && \
-test -d "$cf_library_path" && \
- {
- test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path"
- test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib"
- test -d $cf_library_path/lib/utf8 && cf_search="$cf_search $cf_library_path/lib/utf8"
- test -d $cf_library_path/lib/utf8/lib && cf_search="$cf_search $cf_library_path/lib/utf8/lib"
- test -d $cf_library_path/utf8/lib && cf_search="$cf_search $cf_library_path/utf8/lib"
- test -d $cf_library_path/utf8/lib/utf8 && cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
-}
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
- cf_library_path_list="$cf_library_path_list $cf_search"
- ;;
- esac
- done
fi
-cf_search=
-
-test "x$prefix" != "xNONE" && \
-test -d "$prefix" && \
- {
- test -n "$verbose" && echo " ... testing for lib-directories under $prefix"
- test -d $prefix/lib && cf_search="$cf_search $prefix/lib"
- test -d $prefix/lib/utf8 && cf_search="$cf_search $prefix/lib/utf8"
- test -d $prefix/lib/utf8/lib && cf_search="$cf_search $prefix/lib/utf8/lib"
- test -d $prefix/utf8/lib && cf_search="$cf_search $prefix/utf8/lib"
- test -d $prefix/utf8/lib/utf8 && cf_search="$cf_search $prefix/utf8/lib/utf8"
-}
+if test -n "$cf_new_extra_cppflags" ; then
-for cf_subdir_prefix in \
- /usr \
- /usr/local \
- /usr/pkg \
- /opt \
- /opt/local \
- $HOME
-do
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
-test "x$cf_subdir_prefix" != "x$prefix" && \
-test -d "$cf_subdir_prefix" && \
-(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
- test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix"
- test -d $cf_subdir_prefix/lib && cf_search="$cf_search $cf_subdir_prefix/lib"
- test -d $cf_subdir_prefix/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
- test -d $cf_subdir_prefix/lib/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
- test -d $cf_subdir_prefix/utf8/lib && cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
- test -d $cf_subdir_prefix/utf8/lib/utf8 && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
-}
+fi
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs $cf_ncuconfig_root`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
+LIBS="$cf_add_libs"
-cf_search="$cf_library_path_list $cf_search"
-
- for cf_cv_library_path_utf8 in $cf_search
- do
- if test -d $cf_cv_library_path_utf8 ; then
- test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6
-
-echo "${as_me:-configure}:7257: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
-
- CPPFLAGS="$cf_test_CPPFLAGS"
- LIBS="-lutf8 $cf_save_LIBS"
- LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
- cat >conftest.$ac_ext <<_ACEOF
-#line 7263 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9497 "configure"
#include "confdefs.h"
-
-#include <libutf8.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
-putwc(0,0);
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7276: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9509: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:7279: \$? = $ac_status" >&5
+ echo "$as_me:9512: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:7282: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9515: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7285: \$? = $ac_status" >&5
+ echo "$as_me:9518: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-
- test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
-
-echo "${as_me:-configure}:7290: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
-
- cf_cv_find_linkage_utf8=yes
- cf_cv_library_file_utf8="-lutf8"
- break
+ if test "$cross_compiling" = yes; then
+ cf_have_ncuconfig=maybe
else
- echo "$as_me: failed program was:" >&5
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9524 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+ int main(void)
+ { char *xx = curses_version(); return (xx == 0); }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:9531: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9534: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:9536: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9539: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_have_ncuconfig=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-
- CPPFLAGS="$cf_save_CPPFLAGS"
- LIBS="$cf_save_LIBS"
- LDFLAGS="$cf_save_LDFLAGS"
-
+cf_have_ncuconfig=no
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- fi
- done
- CPPFLAGS="$cf_save_CPPFLAGS"
- LDFLAGS="$cf_save_LDFLAGS"
- fi
-
- else
- cf_cv_find_linkage_utf8=no
- fi
-
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-LIBS="$cf_save_LIBS"
-
-if test "$cf_cv_find_linkage_utf8" = yes ; then
-cf_cv_utf8_lib=add-on
else
-cf_cv_utf8_lib=no
-fi
-
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_ncuconfig=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:7332: result: $cf_cv_utf8_lib" >&5
-echo "${ECHO_T}$cf_cv_utf8_lib" >&6
-
-# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
-# ncurses/ncursesw:
-if test "$cf_cv_utf8_lib" = "add-on" ; then
+ echo "$as_me:9556: result: $cf_have_ncuconfig" >&5
+echo "${ECHO_T}$cf_have_ncuconfig" >&6
+ test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
+ if test "$cf_have_ncuconfig" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ NCURSES_CONFIG_PKG=none
+ else
cat >>confdefs.h <<\EOF
-#define HAVE_LIBUTF8_H 1
+#define NCURSES 1
EOF
-if test -n "$cf_cv_header_path_utf8" ; then
- for cf_add_incdir in $cf_cv_header_path_utf8
- do
- while test $cf_add_incdir != /usr/include
- do
- if test -d $cf_add_incdir
- then
- cf_have_incdir=no
- if test -n "$CFLAGS$CPPFLAGS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
- if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
- cf_have_incdir=yes; break
- fi
- done
- fi
+ NCURSES_CONFIG_PKG=$cf_ncuconfig_root
- if test "$cf_have_incdir" = no ; then
- if test "$cf_add_incdir" = /usr/local/include ; then
- if test "$GCC" = yes
- then
- cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
- cat >conftest.$ac_ext <<_ACEOF
-#line 7367 "configure"
+echo "$as_me:9572: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
+ cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+ ;;
+(*)
+ cf_term_header=term.h
+ ;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 9590 "configure"
#include "confdefs.h"
#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+
int
-main ()
+main (void)
{
-printf("Hello")
+int x = auto_left_margin
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7379: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9605: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7382: \$? = $ac_status" >&5
+ echo "$as_me:9608: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7385: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9611: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7388: \$? = $ac_status" >&5
+ echo "$as_me:9614: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- :
+
+ cf_cv_term_header="$cf_test"
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_have_incdir=yes
+
+ cf_cv_term_header=unknown
+
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- CPPFLAGS=$cf_save_CPPFLAGS
- fi
- fi
- fi
+ test "$cf_cv_term_header" != unknown && break
+done
- if test "$cf_have_incdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
+fi
+echo "$as_me:9630: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
-echo "${as_me:-configure}:7405: testing adding $cf_add_incdir to include-path ..." 1>&5
+# Set definitions to allow ifdef'ing to accommodate subdirectories
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+case $cf_cv_term_header in
+(*term.h)
- cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
- test "$cf_top_incdir" = "$cf_add_incdir" && break
- cf_add_incdir="$cf_top_incdir"
- else
- break
- fi
- fi
- done
- done
-fi
+cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
-if test -n "$cf_cv_library_path_utf8" ; then
- for cf_add_libdir in $cf_cv_library_path_utf8
- do
- if test $cf_add_libdir = /usr/lib ; then
- :
- elif test -d $cf_add_libdir
- then
- cf_have_libdir=no
- if test -n "$LDFLAGS$LIBS" ; then
- # a loop is needed to ensure we can add subdirs of existing dirs
- for cf_test_libdir in $LDFLAGS $LIBS ; do
- if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
- cf_have_libdir=yes; break
- fi
- done
- fi
- if test "$cf_have_libdir" = no ; then
- test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6
+ ;;
+esac
-echo "${as_me:-configure}:7439: testing adding $cf_add_libdir to library-path ..." 1>&5
+case $cf_cv_term_header in
+(ncurses/term.h)
- LDFLAGS="-L$cf_add_libdir $LDFLAGS"
- fi
- fi
- done
-fi
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+ ;;
+(ncursesw/term.h)
+
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+ ;;
+esac
-cf_add_libs="$cf_cv_library_file_utf8"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
- cf_add_1lib=
- break
fi
- done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
-done
-LIBS="$cf_add_libs"
+ else
+ echo "$as_me:9665: result: no" >&5
+echo "${ECHO_T}no" >&6
+ NCURSES_CONFIG_PKG=none
+ fi
+else
+ NCURSES_CONFIG_PKG=none
fi
-cf_ncuconfig_root=ncursesw
-
-echo "Looking for ${cf_ncuconfig_root}-config"
+if test "x$cf_have_ncuconfig" = "xno"; then
+ cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
if test -n "$ac_tool_prefix"; then
- for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:7474: checking for $ac_word" >&5
+echo "$as_me:9681: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7486,7 +9693,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:7489: found $ac_dir/$ac_word" >&5
+echo "$as_me:9696: found $ac_dir/$ac_word" >&5
break
done
@@ -7494,10 +9701,10 @@ fi
fi
NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
if test -n "$NCURSES_CONFIG"; then
- echo "$as_me:7497: result: $NCURSES_CONFIG" >&5
+ echo "$as_me:9704: result: $NCURSES_CONFIG" >&5
echo "${ECHO_T}$NCURSES_CONFIG" >&6
else
- echo "$as_me:7500: result: no" >&5
+ echo "$as_me:9707: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -7506,11 +9713,11 @@ fi
fi
if test -z "$NCURSES_CONFIG"; then
ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
- for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+ for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:7513: checking for $ac_word" >&5
+echo "$as_me:9720: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7525,7 +9732,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
-echo "$as_me:7528: found $ac_dir/$ac_word" >&5
+echo "$as_me:9735: found $ac_dir/$ac_word" >&5
break
done
@@ -7533,10 +9740,10 @@ fi
fi
ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
if test -n "$ac_ct_NCURSES_CONFIG"; then
- echo "$as_me:7536: result: $ac_ct_NCURSES_CONFIG" >&5
+ echo "$as_me:9743: result: $ac_ct_NCURSES_CONFIG" >&5
echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
else
- echo "$as_me:7539: result: no" >&5
+ echo "$as_me:9746: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -7547,47 +9754,141 @@ test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
fi
-if test "$NCURSES_CONFIG" != none ; then
+ if test "$NCURSES_CONFIG" != none ; then
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
-cf_add_libs="`$NCURSES_CONFIG --libs`"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+for cf_add_cflags in `$NCURSES_CONFIG --cflags`
do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
-# even with config script, some packages use no-override for curses.h
+ # even with config script, some packages use no-override for curses.h
-echo "$as_me:7572: checking if we have identified curses headers" >&5
+echo "$as_me:9875: checking if we have identified curses headers" >&5
echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
if test "${cf_cv_ncurses_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cf_cv_ncurses_header=none
-for cf_header in \
- ncursesw/ncurses.h \
- ncursesw/curses.h \
- ncurses.h \
- curses.h
+for cf_header in \
+ ncurses.h $cf_cv_screen/ncurses.h \
+ curses.h $cf_cv_screen/curses.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 7586 "configure"
+#line 9887 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
-main ()
+main (void)
{
initscr(); tgoto("?", 0,0)
;
@@ -7595,16 +9896,16 @@ initscr(); tgoto("?", 0,0)
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7598: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9899: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7601: \$? = $ac_status" >&5
+ echo "$as_me:9902: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7604: \"$ac_try\"") >&5
+ { (eval echo "$as_me:9905: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7607: \$? = $ac_status" >&5
+ echo "$as_me:9908: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_header=$cf_header; break
else
@@ -7615,11 +9916,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:7618: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:9919: result: $cf_cv_ncurses_header" >&5
echo "${ECHO_T}$cf_cv_ncurses_header" >&6
if test "$cf_cv_ncurses_header" = none ; then
- { { echo "$as_me:7622: error: No curses header-files found" >&5
+ { { echo "$as_me:9923: error: No curses header-files found" >&5
echo "$as_me: error: No curses header-files found" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -7629,23 +9930,23 @@ fi
for ac_header in $cf_cv_ncurses_header
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:7632: checking for $ac_header" >&5
+echo "$as_me:9933: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 7638 "configure"
+#line 9939 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:7642: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:9943: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:7648: \$? = $ac_status" >&5
+ echo "$as_me:9949: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -7664,7 +9965,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:7667: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:9968: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -7680,15 +9981,15 @@ EOF
cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-cat >>confdefs.h <<EOF
+ cat >>confdefs.h <<EOF
#define $cf_nculib_ROOT 1
EOF
-cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+ cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
-else
+ else
-cf_ncuhdr_root=ncursesw
+cf_ncuhdr_root=$cf_cv_screen
test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && { \
@@ -7715,13 +10016,16 @@ if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 7720 "configure"
+#line 10024 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -7729,16 +10033,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7732: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10036: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7735: \$? = $ac_status" >&5
+ echo "$as_me:10039: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7738: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10042: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7741: \$? = $ac_status" >&5
+ echo "$as_me:10045: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -7755,7 +10059,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:7758: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10062: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -7765,6 +10069,8 @@ echo "${as_me:-configure}:7758: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -7772,7 +10078,7 @@ fi
}
-echo "$as_me:7775: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:10081: checking for $cf_ncuhdr_root header in include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7784,24 +10090,16 @@ else
do
cat >conftest.$ac_ext <<_ACEOF
-#line 7787 "configure"
+#line 10093 "configure"
#include "confdefs.h"
-#define _XOPEN_SOURCE_EXTENDED
-#undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
-#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
-
#include <$cf_header>
int
-main ()
+main (void)
{
#ifdef NCURSES_VERSION
-#ifndef WACS_BSSB
- make an error
-#endif
-
printf("%s\n", NCURSES_VERSION);
#else
#ifdef __NCURSES_H
@@ -7816,16 +10114,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7819: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10117: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7822: \$? = $ac_status" >&5
+ echo "$as_me:10120: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7825: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10123: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7828: \$? = $ac_status" >&5
+ echo "$as_me:10126: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h=$cf_header
@@ -7840,14 +10138,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:7843: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:10141: result: $cf_cv_ncurses_h" >&5
echo "${ECHO_T}$cf_cv_ncurses_h" >&6
if test "$cf_cv_ncurses_h" != no ; then
cf_cv_ncurses_header=$cf_cv_ncurses_h
else
-echo "$as_me:7850: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:10148: checking for $cf_ncuhdr_root include-path" >&5
echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
if test "${cf_cv_ncurses_h2+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7862,8 +10160,8 @@ cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
for cf_header_path in $CPPFLAGS $CFLAGS
do
- case $cf_header_path in #(vi
- -I*)
+ case $cf_header_path in
+ (-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
test "x$cf_header_path" != "xNONE" && \
@@ -7963,13 +10261,16 @@ if test -n "$cf_incdir" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 7968 "configure"
+#line 10269 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -7977,16 +10278,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7980: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10281: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:7983: \$? = $ac_status" >&5
+ echo "$as_me:10284: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:7986: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10287: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:7989: \$? = $ac_status" >&5
+ echo "$as_me:10290: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -8003,7 +10304,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:8006: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10307: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -8013,6 +10314,8 @@ echo "${as_me:-configure}:8006: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -8024,12 +10327,12 @@ fi
do
cat >conftest.$ac_ext <<_ACEOF
-#line 8027 "configure"
+#line 10330 "configure"
#include "confdefs.h"
#include <$cf_header>
int
-main ()
+main (void)
{
#ifdef NCURSES_VERSION
@@ -8048,16 +10351,16 @@ printf("old\n");
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8051: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10354: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8054: \$? = $ac_status" >&5
+ echo "$as_me:10357: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8057: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10360: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8060: \$? = $ac_status" >&5
+ echo "$as_me:10363: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_h2=$cf_header
@@ -8078,12 +10381,12 @@ rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save2_CPPFLAGS"
test "$cf_cv_ncurses_h2" != no && break
done
- test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8081: error: not found" >&5
+ test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10384: error: not found" >&5
echo "$as_me: error: not found" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:8086: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:10389: result: $cf_cv_ncurses_h2" >&5
echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
@@ -8114,13 +10417,16 @@ if test -n "$cf_1st_incdir" ; then
if test "$GCC" = yes
then
cf_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 8119 "configure"
+#line 10425 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello")
;
@@ -8128,16 +10434,16 @@ printf("Hello")
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8131: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10437: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8134: \$? = $ac_status" >&5
+ echo "$as_me:10440: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8137: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10443: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8140: \$? = $ac_status" >&5
+ echo "$as_me:10446: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -8154,7 +10460,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
if test "$cf_have_incdir" = no ; then
test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6
-echo "${as_me:-configure}:8157: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:10463: testing adding $cf_add_incdir to include-path ..." 1>&5
CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
@@ -8164,6 +10470,8 @@ echo "${as_me:-configure}:8157: testing adding $cf_add_incdir to include-path ..
else
break
fi
+ else
+ break
fi
done
done
@@ -8173,8 +10481,8 @@ fi
# Set definitions to allow ifdef'ing for ncurses.h
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
+case $cf_cv_ncurses_header in
+(*ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_H 1
@@ -8183,15 +10491,15 @@ EOF
;;
esac
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
+case $cf_cv_ncurses_header in
+(ncurses/curses.h|ncurses/ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF
;;
-ncursesw/curses.h|ncursesw/ncurses.h)
+(ncursesw/curses.h|ncursesw/ncurses.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
@@ -8200,17 +10508,17 @@ EOF
;;
esac
-echo "$as_me:8203: checking for terminfo header" >&5
+echo "$as_me:10511: checking for terminfo header" >&5
echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
;;
-*)
+(*)
cf_term_header=term.h
;;
esac
@@ -8218,14 +10526,14 @@ esac
for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat >conftest.$ac_ext <<_ACEOF
-#line 8221 "configure"
+#line 10529 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>
int
-main ()
+main (void)
{
int x = auto_left_margin
;
@@ -8233,16 +10541,16 @@ int x = auto_left_margin
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8236: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10544: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:8239: \$? = $ac_status" >&5
+ echo "$as_me:10547: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:8242: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10550: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8245: \$? = $ac_status" >&5
+ echo "$as_me:10553: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header="$cf_test"
@@ -8258,13 +10566,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:8261: result: $cf_cv_term_header" >&5
+echo "$as_me:10569: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
# Set definitions to allow ifdef'ing to accommodate subdirectories
-case $cf_cv_term_header in # (vi
-*term.h)
+case $cf_cv_term_header in
+(*term.h)
cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
@@ -8273,15 +10581,15 @@ EOF
;;
esac
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
+case $cf_cv_term_header in
+(ncurses/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
-ncursesw/term.h)
+(ncursesw/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
@@ -8296,7 +10604,7 @@ cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-echo "$as_me:8299: checking for ncurses version" >&5
+echo "$as_me:10607: checking for ncurses version" >&5
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
if test "${cf_cv_ncurses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8322,10 +10630,10 @@ Autoconf "old"
#endif
EOF
cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
- { (eval echo "$as_me:8325: \"$cf_try\"") >&5
+ { (eval echo "$as_me:10633: \"$cf_try\"") >&5
(eval $cf_try) 2>&5
ac_status=$?
- echo "$as_me:8328: \$? = $ac_status" >&5
+ echo "$as_me:10636: \$? = $ac_status" >&5
(exit $ac_status); }
if test -f conftest.out ; then
cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
@@ -8335,12 +10643,12 @@ EOF
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8338 "configure"
+#line 10646 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <stdio.h>
-int main()
+int main(void)
{
FILE *fp = fopen("$cf_tempfile", "w");
#ifdef NCURSES_VERSION
@@ -8360,15 +10668,15 @@ int main()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8363: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10671: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8366: \$? = $ac_status" >&5
+ echo "$as_me:10674: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:8368: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10676: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8371: \$? = $ac_status" >&5
+ echo "$as_me:10679: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -8382,20 +10690,20 @@ fi
rm -f $cf_tempfile
fi
-echo "$as_me:8385: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:10693: result: $cf_cv_ncurses_version" >&5
echo "${ECHO_T}$cf_cv_ncurses_version" >&6
test "$cf_cv_ncurses_version" = no ||
cat >>confdefs.h <<\EOF
#define NCURSES 1
EOF
-cf_nculib_root=ncursesw
+cf_nculib_root=$cf_cv_screen
# This works, except for the special case where we find gpm, but
# ncurses is in a nonstandard location via $LIBS, and we really want
# to link gpm.
cf_ncurses_LIBS=""
cf_ncurses_SAVE="$LIBS"
-echo "$as_me:8398: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:10706: checking for Gpm_Open in -lgpm" >&5
echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8403,7 +10711,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8406 "configure"
+#line 10714 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8414,7 +10722,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char Gpm_Open ();
int
-main ()
+main (void)
{
Gpm_Open ();
;
@@ -8422,16 +10730,16 @@ Gpm_Open ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8425: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10733: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8428: \$? = $ac_status" >&5
+ echo "$as_me:10736: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8431: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10739: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8434: \$? = $ac_status" >&5
+ echo "$as_me:10742: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_Gpm_Open=yes
else
@@ -8442,10 +10750,10 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8445: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:10753: result: $ac_cv_lib_gpm_Gpm_Open" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
if test $ac_cv_lib_gpm_Gpm_Open = yes; then
- echo "$as_me:8448: checking for initscr in -lgpm" >&5
+ echo "$as_me:10756: checking for initscr in -lgpm" >&5
echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
if test "${ac_cv_lib_gpm_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8453,7 +10761,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgpm $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8456 "configure"
+#line 10764 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8464,7 +10772,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char initscr ();
int
-main ()
+main (void)
{
initscr ();
;
@@ -8472,16 +10780,16 @@ initscr ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8475: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10783: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8478: \$? = $ac_status" >&5
+ echo "$as_me:10786: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8481: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10789: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8484: \$? = $ac_status" >&5
+ echo "$as_me:10792: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_gpm_initscr=yes
else
@@ -8492,7 +10800,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8495: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:10803: result: $ac_cv_lib_gpm_initscr" >&5
echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
if test $ac_cv_lib_gpm_initscr = yes; then
LIBS="$cf_ncurses_SAVE"
@@ -8502,12 +10810,12 @@ fi
fi
-case $host_os in #(vi
-freebsd*)
+case $host_os in
+(freebsd*)
# This is only necessary if you are linking against an obsolete
# version of ncurses (but it should do no harm, since it's static).
if test "$cf_nculib_root" = ncurses ; then
- echo "$as_me:8510: checking for tgoto in -lmytinfo" >&5
+ echo "$as_me:10818: checking for tgoto in -lmytinfo" >&5
echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8515,7 +10823,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lmytinfo $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8518 "configure"
+#line 10826 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -8526,7 +10834,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char tgoto ();
int
-main ()
+main (void)
{
tgoto ();
;
@@ -8534,16 +10842,16 @@ tgoto ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8537: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10845: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8540: \$? = $ac_status" >&5
+ echo "$as_me:10848: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8543: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10851: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8546: \$? = $ac_status" >&5
+ echo "$as_me:10854: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_mytinfo_tgoto=yes
else
@@ -8554,7 +10862,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:8557: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:10865: result: $ac_cv_lib_mytinfo_tgoto" >&5
echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
if test $ac_cv_lib_mytinfo_tgoto = yes; then
cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
@@ -8564,38 +10872,38 @@ fi
;;
esac
-cf_add_libs="$cf_ncurses_LIBS"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
-cf_add_libs="-l$cf_nculib_root"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -8603,53 +10911,53 @@ else
eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
cf_libdir=""
- echo "$as_me:8606: checking for initscr" >&5
+ echo "$as_me:10914: checking for initscr" >&5
echo $ECHO_N "checking for initscr... $ECHO_C" >&6
if test "${ac_cv_func_initscr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 8612 "configure"
+#line 10920 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char initscr (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define initscr autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef initscr
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char initscr ();
-char (*f) ();
+char initscr (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_initscr) || defined (__stub___initscr)
-choke me
-#else
-f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for initscr
#endif
+ return initscr ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8643: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10951: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8646: \$? = $ac_status" >&5
+ echo "$as_me:10954: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8649: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10957: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8652: \$? = $ac_status" >&5
+ echo "$as_me:10960: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_initscr=yes
else
@@ -8659,22 +10967,22 @@ ac_cv_func_initscr=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:8662: result: $ac_cv_func_initscr" >&5
+echo "$as_me:10970: result: $ac_cv_func_initscr" >&5
echo "${ECHO_T}$ac_cv_func_initscr" >&6
if test $ac_cv_func_initscr = yes; then
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
cf_save_LIBS="$LIBS"
- echo "$as_me:8669: checking for initscr in -l$cf_nculib_root" >&5
+ echo "$as_me:10977: checking for initscr in -l$cf_nculib_root" >&5
echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
LIBS="-l$cf_nculib_root $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8673 "configure"
+#line 10981 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr()
;
@@ -8682,25 +10990,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8685: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10993: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8688: \$? = $ac_status" >&5
+ echo "$as_me:10996: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8691: \"$ac_try\"") >&5
+ { (eval echo "$as_me:10999: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8694: \$? = $ac_status" >&5
+ echo "$as_me:11002: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:8696: result: yes" >&5
+ echo "$as_me:11004: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:8703: result: no" >&5
+echo "$as_me:11011: result: no" >&5
echo "${ECHO_T}no" >&6
cf_search=
@@ -8708,8 +11016,8 @@ cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
for cf_library_path in $LDFLAGS $LIBS
do
- case $cf_library_path in #(vi
- -L*)
+ case $cf_library_path in
+ (-L*)
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
test "x$cf_library_path" != "xNONE" && \
@@ -8768,15 +11076,15 @@ cf_search="$cf_library_path_list $cf_search"
for cf_libdir in $cf_search
do
- echo "$as_me:8771: checking for -l$cf_nculib_root in $cf_libdir" >&5
+ echo "$as_me:11079: checking for -l$cf_nculib_root in $cf_libdir" >&5
echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 8775 "configure"
+#line 11083 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr()
;
@@ -8784,25 +11092,25 @@ initscr()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11095: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8790: \$? = $ac_status" >&5
+ echo "$as_me:11098: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8793: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11101: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8796: \$? = $ac_status" >&5
+ echo "$as_me:11104: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:8798: result: yes" >&5
+ echo "$as_me:11106: result: yes" >&5
echo "${ECHO_T}yes" >&6
eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:8805: result: no" >&5
+echo "$as_me:11113: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_save_LIBS"
fi
@@ -8817,7 +11125,7 @@ fi
eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
if test $cf_found_library = no ; then
- { { echo "$as_me:8820: error: Cannot link $cf_nculib_root library" >&5
+ { { echo "$as_me:11128: error: Cannot link $cf_nculib_root library" >&5
echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -8825,7 +11133,7 @@ fi
fi
if test -n "$cf_ncurses_LIBS" ; then
- echo "$as_me:8828: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+ echo "$as_me:11136: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
cf_ncurses_SAVE="$LIBS"
for p in $cf_ncurses_LIBS ; do
@@ -8835,11 +11143,11 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
fi
done
cat >conftest.$ac_ext <<_ACEOF
-#line 8838 "configure"
+#line 11146 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
;
@@ -8847,23 +11155,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8850: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11158: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:8853: \$? = $ac_status" >&5
+ echo "$as_me:11161: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:8856: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11164: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:8859: \$? = $ac_status" >&5
+ echo "$as_me:11167: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- echo "$as_me:8861: result: yes" >&5
+ echo "$as_me:11169: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:8866: result: no" >&5
+echo "$as_me:11174: result: no" >&5
echo "${ECHO_T}no" >&6
LIBS="$cf_ncurses_SAVE"
fi
@@ -8876,11 +11184,14 @@ cat >>confdefs.h <<EOF
#define $cf_nculib_ROOT 1
EOF
+ fi
+else
+ NCURSES_CONFIG=none
fi
;;
-pdcurses)
- echo "$as_me:8883: checking for X" >&5
+(pdcurses)
+ echo "$as_me:11194: checking for X" >&5
echo $ECHO_N "checking for X... $ECHO_C" >&6
# Check whether --with-x or --without-x was given.
@@ -8940,21 +11251,28 @@ fi
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='
/usr/X11/include
+/usr/X11R7/include
/usr/X11R6/include
/usr/X11R5/include
/usr/X11R4/include
+/opt/local/include
+/opt/X11/include
+
/usr/include/X11
+/usr/include/X11R7
/usr/include/X11R6
/usr/include/X11R5
/usr/include/X11R4
/usr/local/X11/include
+/usr/local/X11R7/include
/usr/local/X11R6/include
/usr/local/X11R5/include
/usr/local/X11R4/include
/usr/local/include/X11
+/usr/local/include/X11R7
/usr/local/include/X11R6
/usr/local/include/X11R5
/usr/local/include/X11R4
@@ -8977,17 +11295,17 @@ if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
-#line 8980 "configure"
+#line 11298 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
_ACEOF
-if { (eval echo "$as_me:8984: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:11302: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:8990: \$? = $ac_status" >&5
+ echo "$as_me:11308: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9020,11 +11338,11 @@ if test "$ac_x_libraries" = no; then
ac_save_LIBS=$LIBS
LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9023 "configure"
+#line 11341 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
int
-main ()
+main (void)
{
XtMalloc (0)
;
@@ -9032,16 +11350,16 @@ XtMalloc (0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9035: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11353: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9038: \$? = $ac_status" >&5
+ echo "$as_me:11356: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9041: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11359: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9044: \$? = $ac_status" >&5
+ echo "$as_me:11362: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
LIBS=$ac_save_LIBS
# We can link X programs with no special library path.
@@ -9079,7 +11397,7 @@ fi
fi # $with_x != no
if test "$have_x" != yes; then
- echo "$as_me:9082: result: $have_x" >&5
+ echo "$as_me:11400: result: $have_x" >&5
echo "${ECHO_T}$have_x" >&6
no_x=yes
else
@@ -9089,7 +11407,7 @@ else
# Update the cache value to reflect the command line values.
ac_cv_have_x="have_x=yes \
ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
- echo "$as_me:9092: result: libraries $x_libraries, headers $x_includes" >&5
+ echo "$as_me:11410: result: libraries $x_libraries, headers $x_includes" >&5
echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
fi
@@ -9113,15 +11431,15 @@ else
# others require no space. Words are not sufficient . . . .
case `(uname -sr) 2>/dev/null` in
"SunOS 5"*)
- echo "$as_me:9116: checking whether -R must be followed by a space" >&5
+ echo "$as_me:11434: checking whether -R must be followed by a space" >&5
echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 9120 "configure"
+#line 11438 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -9129,16 +11447,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9132: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11450: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9135: \$? = $ac_status" >&5
+ echo "$as_me:11453: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9138: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11456: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9141: \$? = $ac_status" >&5
+ echo "$as_me:11459: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_nospace=yes
else
@@ -9148,17 +11466,17 @@ ac_R_nospace=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_nospace = yes; then
- echo "$as_me:9151: result: no" >&5
+ echo "$as_me:11469: result: no" >&5
echo "${ECHO_T}no" >&6
X_LIBS="$X_LIBS -R$x_libraries"
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat >conftest.$ac_ext <<_ACEOF
-#line 9157 "configure"
+#line 11475 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -9166,16 +11484,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9169: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11487: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9172: \$? = $ac_status" >&5
+ echo "$as_me:11490: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9175: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11493: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9178: \$? = $ac_status" >&5
+ echo "$as_me:11496: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_R_space=yes
else
@@ -9185,11 +11503,11 @@ ac_R_space=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test $ac_R_space = yes; then
- echo "$as_me:9188: result: yes" >&5
+ echo "$as_me:11506: result: yes" >&5
echo "${ECHO_T}yes" >&6
X_LIBS="$X_LIBS -R $x_libraries"
else
- echo "$as_me:9192: result: neither works" >&5
+ echo "$as_me:11510: result: neither works" >&5
echo "${ECHO_T}neither works" >&6
fi
fi
@@ -9209,7 +11527,7 @@ echo "${ECHO_T}neither works" >&6
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
cat >conftest.$ac_ext <<_ACEOF
-#line 9212 "configure"
+#line 11530 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9220,7 +11538,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char XOpenDisplay ();
int
-main ()
+main (void)
{
XOpenDisplay ();
;
@@ -9228,22 +11546,22 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9231: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11549: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9234: \$? = $ac_status" >&5
+ echo "$as_me:11552: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9237: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11555: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9240: \$? = $ac_status" >&5
+ echo "$as_me:11558: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-echo "$as_me:9246: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:11564: checking for dnet_ntoa in -ldnet" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9251,7 +11569,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9254 "configure"
+#line 11572 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9262,7 +11580,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char dnet_ntoa ();
int
-main ()
+main (void)
{
dnet_ntoa ();
;
@@ -9270,16 +11588,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9273: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11591: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9276: \$? = $ac_status" >&5
+ echo "$as_me:11594: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9279: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11597: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9282: \$? = $ac_status" >&5
+ echo "$as_me:11600: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_dnet_ntoa=yes
else
@@ -9290,14 +11608,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9293: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:11611: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
- echo "$as_me:9300: checking for dnet_ntoa in -ldnet_stub" >&5
+ echo "$as_me:11618: checking for dnet_ntoa in -ldnet_stub" >&5
echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9305,7 +11623,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9308 "configure"
+#line 11626 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9316,7 +11634,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char dnet_ntoa ();
int
-main ()
+main (void)
{
dnet_ntoa ();
;
@@ -9324,16 +11642,16 @@ dnet_ntoa ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9327: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11645: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9330: \$? = $ac_status" >&5
+ echo "$as_me:11648: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9333: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11651: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9336: \$? = $ac_status" >&5
+ echo "$as_me:11654: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dnet_stub_dnet_ntoa=yes
else
@@ -9344,7 +11662,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9347: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:11665: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
@@ -9363,53 +11681,53 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
# on Irix 5.2, according to T.E. Dickey.
# The functions gethostbyname, getservbyname, and inet_addr are
# in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
- echo "$as_me:9366: checking for gethostbyname" >&5
+ echo "$as_me:11684: checking for gethostbyname" >&5
echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9372 "configure"
+#line 11690 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define gethostbyname autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef gethostbyname
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char gethostbyname ();
-char (*f) ();
+char gethostbyname (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for gethostbyname
#endif
+ return gethostbyname ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9403: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11721: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9406: \$? = $ac_status" >&5
+ echo "$as_me:11724: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9409: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11727: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9412: \$? = $ac_status" >&5
+ echo "$as_me:11730: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_gethostbyname=yes
else
@@ -9419,11 +11737,11 @@ ac_cv_func_gethostbyname=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:9422: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:11740: result: $ac_cv_func_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
if test $ac_cv_func_gethostbyname = no; then
- echo "$as_me:9426: checking for gethostbyname in -lnsl" >&5
+ echo "$as_me:11744: checking for gethostbyname in -lnsl" >&5
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9431,7 +11749,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9434 "configure"
+#line 11752 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9442,7 +11760,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char gethostbyname ();
int
-main ()
+main (void)
{
gethostbyname ();
;
@@ -9450,16 +11768,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9453: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11771: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9456: \$? = $ac_status" >&5
+ echo "$as_me:11774: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9459: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11777: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9462: \$? = $ac_status" >&5
+ echo "$as_me:11780: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_nsl_gethostbyname=yes
else
@@ -9470,14 +11788,14 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9473: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:11791: result: $ac_cv_lib_nsl_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
if test $ac_cv_lib_nsl_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
- echo "$as_me:9480: checking for gethostbyname in -lbsd" >&5
+ echo "$as_me:11798: checking for gethostbyname in -lbsd" >&5
echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9485,7 +11803,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9488 "configure"
+#line 11806 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9496,7 +11814,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char gethostbyname ();
int
-main ()
+main (void)
{
gethostbyname ();
;
@@ -9504,16 +11822,16 @@ gethostbyname ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9507: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11825: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9510: \$? = $ac_status" >&5
+ echo "$as_me:11828: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9513: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11831: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9516: \$? = $ac_status" >&5
+ echo "$as_me:11834: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_bsd_gethostbyname=yes
else
@@ -9524,7 +11842,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9527: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:11845: result: $ac_cv_lib_bsd_gethostbyname" >&5
echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
if test $ac_cv_lib_bsd_gethostbyname = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
@@ -9540,53 +11858,53 @@ fi
# variants that don't use the nameserver (or something). -lsocket
# must be given before -lnsl if both are needed. We assume that
# if connect needs -lnsl, so does gethostbyname.
- echo "$as_me:9543: checking for connect" >&5
+ echo "$as_me:11861: checking for connect" >&5
echo $ECHO_N "checking for connect... $ECHO_C" >&6
if test "${ac_cv_func_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9549 "configure"
+#line 11867 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char connect (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define connect autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef connect
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char connect ();
-char (*f) ();
+char connect (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_connect) || defined (__stub___connect)
-choke me
-#else
-f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for connect
#endif
+ return connect ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9580: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11898: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9583: \$? = $ac_status" >&5
+ echo "$as_me:11901: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9586: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11904: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9589: \$? = $ac_status" >&5
+ echo "$as_me:11907: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_connect=yes
else
@@ -9596,11 +11914,11 @@ ac_cv_func_connect=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:9599: result: $ac_cv_func_connect" >&5
+echo "$as_me:11917: result: $ac_cv_func_connect" >&5
echo "${ECHO_T}$ac_cv_func_connect" >&6
if test $ac_cv_func_connect = no; then
- echo "$as_me:9603: checking for connect in -lsocket" >&5
+ echo "$as_me:11921: checking for connect in -lsocket" >&5
echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
if test "${ac_cv_lib_socket_connect+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9608,7 +11926,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9611 "configure"
+#line 11929 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9619,7 +11937,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char connect ();
int
-main ()
+main (void)
{
connect ();
;
@@ -9627,16 +11945,16 @@ connect ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9630: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11948: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9633: \$? = $ac_status" >&5
+ echo "$as_me:11951: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9636: \"$ac_try\"") >&5
+ { (eval echo "$as_me:11954: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9639: \$? = $ac_status" >&5
+ echo "$as_me:11957: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_socket_connect=yes
else
@@ -9647,7 +11965,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9650: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:11968: result: $ac_cv_lib_socket_connect" >&5
echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
if test $ac_cv_lib_socket_connect = yes; then
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
@@ -9656,53 +11974,53 @@ fi
fi
# Guillermo Gomez says -lposix is necessary on A/UX.
- echo "$as_me:9659: checking for remove" >&5
+ echo "$as_me:11977: checking for remove" >&5
echo $ECHO_N "checking for remove... $ECHO_C" >&6
if test "${ac_cv_func_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9665 "configure"
+#line 11983 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char remove (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define remove autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef remove
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char remove ();
-char (*f) ();
+char remove (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_remove) || defined (__stub___remove)
-choke me
-#else
-f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for remove
#endif
+ return remove ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9696: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12014: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9699: \$? = $ac_status" >&5
+ echo "$as_me:12017: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9702: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12020: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9705: \$? = $ac_status" >&5
+ echo "$as_me:12023: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_remove=yes
else
@@ -9712,11 +12030,11 @@ ac_cv_func_remove=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:9715: result: $ac_cv_func_remove" >&5
+echo "$as_me:12033: result: $ac_cv_func_remove" >&5
echo "${ECHO_T}$ac_cv_func_remove" >&6
if test $ac_cv_func_remove = no; then
- echo "$as_me:9719: checking for remove in -lposix" >&5
+ echo "$as_me:12037: checking for remove in -lposix" >&5
echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
if test "${ac_cv_lib_posix_remove+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9724,7 +12042,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9727 "configure"
+#line 12045 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9735,7 +12053,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char remove ();
int
-main ()
+main (void)
{
remove ();
;
@@ -9743,16 +12061,16 @@ remove ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9746: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12064: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9749: \$? = $ac_status" >&5
+ echo "$as_me:12067: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9752: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12070: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9755: \$? = $ac_status" >&5
+ echo "$as_me:12073: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_posix_remove=yes
else
@@ -9763,7 +12081,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9766: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:12084: result: $ac_cv_lib_posix_remove" >&5
echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
if test $ac_cv_lib_posix_remove = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
@@ -9772,53 +12090,53 @@ fi
fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
- echo "$as_me:9775: checking for shmat" >&5
+ echo "$as_me:12093: checking for shmat" >&5
echo $ECHO_N "checking for shmat... $ECHO_C" >&6
if test "${ac_cv_func_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 9781 "configure"
+#line 12099 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shmat (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define shmat autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef shmat
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char shmat ();
-char (*f) ();
+char shmat (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_shmat) || defined (__stub___shmat)
-choke me
-#else
-f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for shmat
#endif
+ return shmat ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9812: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12130: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9815: \$? = $ac_status" >&5
+ echo "$as_me:12133: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9818: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12136: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9821: \$? = $ac_status" >&5
+ echo "$as_me:12139: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_shmat=yes
else
@@ -9828,11 +12146,11 @@ ac_cv_func_shmat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:9831: result: $ac_cv_func_shmat" >&5
+echo "$as_me:12149: result: $ac_cv_func_shmat" >&5
echo "${ECHO_T}$ac_cv_func_shmat" >&6
if test $ac_cv_func_shmat = no; then
- echo "$as_me:9835: checking for shmat in -lipc" >&5
+ echo "$as_me:12153: checking for shmat in -lipc" >&5
echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
if test "${ac_cv_lib_ipc_shmat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9840,7 +12158,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9843 "configure"
+#line 12161 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9851,7 +12169,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char shmat ();
int
-main ()
+main (void)
{
shmat ();
;
@@ -9859,16 +12177,16 @@ shmat ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9862: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12180: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9865: \$? = $ac_status" >&5
+ echo "$as_me:12183: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9868: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12186: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9871: \$? = $ac_status" >&5
+ echo "$as_me:12189: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ipc_shmat=yes
else
@@ -9879,7 +12197,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9882: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:12200: result: $ac_cv_lib_ipc_shmat" >&5
echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
if test $ac_cv_lib_ipc_shmat = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
@@ -9897,7 +12215,7 @@ fi
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# John Interrante, Karl Berry
- echo "$as_me:9900: checking for IceConnectionNumber in -lICE" >&5
+ echo "$as_me:12218: checking for IceConnectionNumber in -lICE" >&5
echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9905,7 +12223,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 9908 "configure"
+#line 12226 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -9916,7 +12234,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char IceConnectionNumber ();
int
-main ()
+main (void)
{
IceConnectionNumber ();
;
@@ -9924,16 +12242,16 @@ IceConnectionNumber ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9927: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12245: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:9930: \$? = $ac_status" >&5
+ echo "$as_me:12248: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:9933: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12251: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:9936: \$? = $ac_status" >&5
+ echo "$as_me:12254: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_ICE_IceConnectionNumber=yes
else
@@ -9944,7 +12262,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:9947: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:12265: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
@@ -9956,7 +12274,7 @@ fi
cf_x_athena=${cf_x_athena:-Xaw}
-echo "$as_me:9959: checking if you want to link with Xaw 3d library" >&5
+echo "$as_me:12277: checking if you want to link with Xaw 3d library" >&5
echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
withval=
@@ -9967,14 +12285,14 @@ if test "${with_Xaw3d+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=Xaw3d
- echo "$as_me:9970: result: yes" >&5
+ echo "$as_me:12288: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:9973: result: no" >&5
+ echo "$as_me:12291: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:9977: checking if you want to link with Xaw 3d xft library" >&5
+echo "$as_me:12295: checking if you want to link with Xaw 3d xft library" >&5
echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
withval=
@@ -9985,14 +12303,14 @@ if test "${with_Xaw3dxft+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=Xaw3dxft
- echo "$as_me:9988: result: yes" >&5
+ echo "$as_me:12306: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:9991: result: no" >&5
+ echo "$as_me:12309: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:9995: checking if you want to link with neXT Athena library" >&5
+echo "$as_me:12313: checking if you want to link with neXT Athena library" >&5
echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
withval=
@@ -10003,14 +12321,14 @@ if test "${with_neXtaw+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=neXtaw
- echo "$as_me:10006: result: yes" >&5
+ echo "$as_me:12324: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:10009: result: no" >&5
+ echo "$as_me:12327: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-echo "$as_me:10013: checking if you want to link with Athena-Plus library" >&5
+echo "$as_me:12331: checking if you want to link with Athena-Plus library" >&5
echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
withval=
@@ -10021,10 +12339,10 @@ if test "${with_XawPlus+set}" = set; then
fi;
if test "$withval" = yes ; then
cf_x_athena=XawPlus
- echo "$as_me:10024: result: yes" >&5
+ echo "$as_me:12342: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
- echo "$as_me:10027: result: no" >&5
+ echo "$as_me:12345: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -10044,17 +12362,17 @@ if test "$PKG_CONFIG" != none ; then
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
test -n "$verbose" && echo " found package $cf_athena_pkg" 1>&6
-echo "${as_me:-configure}:10047: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:12365: testing found package $cf_athena_pkg ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs $cf_athena_pkg 2>/dev/null`"
test -n "$verbose" && echo " package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10053: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12371: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10057: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12375: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10064,11 +12382,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10076,20 +12394,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10098,17 +12422,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10121,32 +12453,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10161,30 +12499,30 @@ EOF
for cf_trim_lib in Xmu Xt X11
do
case "$LIBS" in
- *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
-echo "${as_me:-configure}:10168: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12506: testing ..trimmed $LIBS ..." 1>&5
;;
esac
done
-echo "$as_me:10174: checking for usable $cf_x_athena/Xmu package" >&5
+echo "$as_me:12512: checking for usable $cf_x_athena/Xmu package" >&5
echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
if test "${cf_cv_xaw_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 10181 "configure"
+#line 12519 "configure"
#include "confdefs.h"
#include <X11/Xmu/CharSet.h>
int
-main ()
+main (void)
{
int check = XmuCompareISOLatin1("big", "small")
@@ -10194,16 +12532,16 @@ int check = XmuCompareISOLatin1("big", "small")
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10197: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12535: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10200: \$? = $ac_status" >&5
+ echo "$as_me:12538: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10203: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12541: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10206: \$? = $ac_status" >&5
+ echo "$as_me:12544: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xaw_compat=yes
else
@@ -10213,19 +12551,19 @@ cf_cv_xaw_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:10216: result: $cf_cv_xaw_compat" >&5
+echo "$as_me:12554: result: $cf_cv_xaw_compat" >&5
echo "${ECHO_T}$cf_cv_xaw_compat" >&6
if test "$cf_cv_xaw_compat" = no
then
# workaround for broken ".pc" files...
- case "$cf_x_athena_lib" in #(vi
- *-lXmu*) #(vi
+ case "$cf_x_athena_lib" in
+ (*-lXmu*)
;;
- *)
+ (*)
test -n "$verbose" && echo " work around broken package" 1>&6
-echo "${as_me:-configure}:10228: testing work around broken package ..." 1>&5
+echo "${as_me:-configure}:12566: testing work around broken package ..." 1>&5
cf_save_xmu="$LIBS"
cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^ *//' -e 's/ .*//'`
@@ -10233,17 +12571,17 @@ echo "${as_me:-configure}:10228: testing work around broken package ..." 1>&5
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
test -n "$verbose" && echo " found package xmu" 1>&6
-echo "${as_me:-configure}:10236: testing found package xmu ..." 1>&5
+echo "${as_me:-configure}:12574: testing found package xmu ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs xmu 2>/dev/null`"
test -n "$verbose" && echo " package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10242: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12580: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package xmu LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10246: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12584: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10253,11 +12591,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10265,20 +12603,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10287,17 +12631,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10310,32 +12662,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10343,12 +12701,12 @@ LIBS="$cf_add_libs"
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:10346: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12704: testing ...before $LIBS ..." 1>&5
LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:10351: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:12709: testing ...after $LIBS ..." 1>&5
else
cf_pkgconfig_incs=
@@ -10356,23 +12714,23 @@ else
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:10359: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:12717: testing ...before $LIBS ..." 1>&5
LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:10364: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:12722: testing ...after $LIBS ..." 1>&5
fi
for cf_trim_lib in Xmu Xt X11
do
case "$LIBS" in
- *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+ (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
test -n "$verbose" && echo " ..trimmed $LIBS" 1>&6
-echo "${as_me:-configure}:10375: testing ..trimmed $LIBS ..." 1>&5
+echo "${as_me:-configure}:12733: testing ..trimmed $LIBS ..." 1>&5
;;
esac
@@ -10397,17 +12755,17 @@ if test -z "$cf_x_athena_lib" ; then
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
test -n "$verbose" && echo " found package Xext" 1>&6
-echo "${as_me:-configure}:10400: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:12758: testing found package Xext ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs Xext 2>/dev/null`"
test -n "$verbose" && echo " package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10406: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12764: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package Xext LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10410: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12768: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10417,11 +12775,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10429,20 +12787,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10451,17 +12815,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10474,32 +12846,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10508,7 +12886,7 @@ else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
- echo "$as_me:10511: checking for XextCreateExtension in -lXext" >&5
+ echo "$as_me:12889: checking for XextCreateExtension in -lXext" >&5
echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10516,7 +12894,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXext $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 10519 "configure"
+#line 12897 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -10527,7 +12905,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char XextCreateExtension ();
int
-main ()
+main (void)
{
XextCreateExtension ();
;
@@ -10535,16 +12913,16 @@ XextCreateExtension ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10538: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12916: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:10541: \$? = $ac_status" >&5
+ echo "$as_me:12919: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:10544: \"$ac_try\"") >&5
+ { (eval echo "$as_me:12922: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:10547: \$? = $ac_status" >&5
+ echo "$as_me:12925: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xext_XextCreateExtension=yes
else
@@ -10555,23 +12933,23 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:10558: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "$as_me:12936: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
-cf_add_libs="-lXext"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10579,7 +12957,7 @@ fi
fi
-# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
# in some cases has installed dummy files in the former, other cases replaced
# it with a link to the new location). This complicates the configure script.
# Check for that pitfall, and recover using pkg-config
@@ -10591,17 +12969,17 @@ then
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
test -n "$verbose" && echo " found package x11" 1>&6
-echo "${as_me:-configure}:10594: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:12972: testing found package x11 ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`"
test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10600: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:12978: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10604: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:12982: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10611,11 +12989,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10623,20 +13001,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10645,17 +13029,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10668,32 +13060,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10701,24 +13099,24 @@ LIBS="$cf_add_libs"
else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
- { echo "$as_me:10704: WARNING: unable to find X11 library" >&5
+ { echo "$as_me:13102: WARNING: unable to find X11 library" >&5
echo "$as_me: WARNING: unable to find X11 library" >&2;}
fi
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
test -n "$verbose" && echo " found package ice" 1>&6
-echo "${as_me:-configure}:10711: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:13109: testing found package ice ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`"
test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10717: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13115: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10721: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13119: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10728,11 +13126,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10740,20 +13138,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10762,17 +13166,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10785,32 +13197,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10818,24 +13236,24 @@ LIBS="$cf_add_libs"
else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
- { echo "$as_me:10821: WARNING: unable to find ICE library" >&5
+ { echo "$as_me:13239: WARNING: unable to find ICE library" >&5
echo "$as_me: WARNING: unable to find ICE library" >&2;}
fi
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
test -n "$verbose" && echo " found package sm" 1>&6
-echo "${as_me:-configure}:10828: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:13246: testing found package sm ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`"
test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10834: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13252: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10838: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13256: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10845,11 +13263,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10857,20 +13275,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10879,17 +13303,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -10902,32 +13334,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -10935,24 +13373,24 @@ LIBS="$cf_add_libs"
else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
- { echo "$as_me:10938: WARNING: unable to find SM library" >&5
+ { echo "$as_me:13376: WARNING: unable to find SM library" >&5
echo "$as_me: WARNING: unable to find SM library" >&2;}
fi
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
test -n "$verbose" && echo " found package xt" 1>&6
-echo "${as_me:-configure}:10945: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13383: testing found package xt ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`"
test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:10951: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13389: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:10955: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13393: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -10962,11 +13400,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -10974,20 +13412,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -10996,17 +13440,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11019,32 +13471,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -11052,7 +13510,7 @@ LIBS="$cf_add_libs"
else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
- { echo "$as_me:11055: WARNING: unable to find Xt library" >&5
+ { echo "$as_me:13513: WARNING: unable to find Xt library" >&5
echo "$as_me: WARNING: unable to find Xt library" >&2;}
fi
@@ -11063,17 +13521,17 @@ cf_have_X_LIBS=no
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
test -n "$verbose" && echo " found package xt" 1>&6
-echo "${as_me:-configure}:11066: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:13524: testing found package xt ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs xt 2>/dev/null`"
test -n "$verbose" && echo " package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11072: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13530: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package xt LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11076: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13534: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11083,11 +13541,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -11095,20 +13553,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -11117,17 +13581,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11140,54 +13612,60 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
- case "x$LIBS" in #(vi
- *-lX11*) #(vi
+ case "x$LIBS" in
+ (*-lX11*)
;;
- *)
+ (*)
# we have an "xt" package, but it may omit Xt's dependency on X11
-echo "$as_me:11177: checking for usable X dependency" >&5
+echo "$as_me:13655: checking for usable X dependency" >&5
echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
if test "${cf_cv_xt_x11_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11184 "configure"
+#line 13662 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
int
-main ()
+main (void)
{
int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
@@ -11200,16 +13678,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11203: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13681: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11206: \$? = $ac_status" >&5
+ echo "$as_me:13684: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11209: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13687: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11212: \$? = $ac_status" >&5
+ echo "$as_me:13690: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xt_x11_compat=yes
else
@@ -11219,30 +13697,30 @@ cf_cv_xt_x11_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11222: result: $cf_cv_xt_x11_compat" >&5
+echo "$as_me:13700: result: $cf_cv_xt_x11_compat" >&5
echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
if test "$cf_cv_xt_x11_compat" = no
then
test -n "$verbose" && echo " work around broken X11 dependency" 1>&6
-echo "${as_me:-configure}:11228: testing work around broken X11 dependency ..." 1>&5
+echo "${as_me:-configure}:13706: testing work around broken X11 dependency ..." 1>&5
# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
test -n "$verbose" && echo " found package x11" 1>&6
-echo "${as_me:-configure}:11235: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:13713: testing found package x11 ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs x11 2>/dev/null`"
test -n "$verbose" && echo " package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11241: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13719: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package x11 LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11245: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13723: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11252,11 +13730,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -11264,20 +13742,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -11286,17 +13770,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11309,32 +13801,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -11345,12 +13843,12 @@ else
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:11348: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:13846: testing ...before $LIBS ..." 1>&5
LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:11353: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:13851: testing ...after $LIBS ..." 1>&5
fi
@@ -11358,20 +13856,20 @@ fi
;;
esac
-echo "$as_me:11361: checking for usable X Toolkit package" >&5
+echo "$as_me:13859: checking for usable X Toolkit package" >&5
echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
if test "${cf_cv_xt_ice_compat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11368 "configure"
+#line 13866 "configure"
#include "confdefs.h"
#include <X11/Shell.h>
int
-main ()
+main (void)
{
int num = IceConnectionNumber(0)
@@ -11380,16 +13878,16 @@ int num = IceConnectionNumber(0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11383: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13881: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11386: \$? = $ac_status" >&5
+ echo "$as_me:13884: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11389: \"$ac_try\"") >&5
+ { (eval echo "$as_me:13887: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11392: \$? = $ac_status" >&5
+ echo "$as_me:13890: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_xt_ice_compat=yes
else
@@ -11399,36 +13897,36 @@ cf_cv_xt_ice_compat=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11402: result: $cf_cv_xt_ice_compat" >&5
+echo "$as_me:13900: result: $cf_cv_xt_ice_compat" >&5
echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
if test "$cf_cv_xt_ice_compat" = no
then
# workaround for broken ".pc" files used for X Toolkit.
- case "x$X_PRE_LIBS" in #(vi
- *-lICE*)
- case "x$LIBS" in #(vi
- *-lICE*) #(vi
+ case "x$X_PRE_LIBS" in
+ (*-lICE*)
+ case "x$LIBS" in
+ (*-lICE*)
;;
- *)
+ (*)
test -n "$verbose" && echo " work around broken ICE dependency" 1>&6
-echo "${as_me:-configure}:11416: testing work around broken ICE dependency ..." 1>&5
+echo "${as_me:-configure}:13914: testing work around broken ICE dependency ..." 1>&5
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
test -n "$verbose" && echo " found package ice" 1>&6
-echo "${as_me:-configure}:11421: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:13919: testing found package ice ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs ice 2>/dev/null`"
test -n "$verbose" && echo " package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11427: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:13925: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package ice LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11431: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:13929: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11438,11 +13936,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -11450,20 +13948,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -11472,17 +13976,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11495,49 +14007,55 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
test -n "$verbose" && echo " found package sm" 1>&6
-echo "${as_me:-configure}:11530: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:14048: testing found package sm ..." 1>&5
cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs sm 2>/dev/null`"
test -n "$verbose" && echo " package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
-echo "${as_me:-configure}:11536: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:14054: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
test -n "$verbose" && echo " package sm LIBS: $cf_pkgconfig_libs" 1>&6
-echo "${as_me:-configure}:11540: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:14058: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
cf_fix_cppflags=no
cf_new_cflags=
@@ -11547,11 +14065,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $cf_pkgconfig_incs
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -11559,20 +14077,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -11581,17 +14105,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11604,32 +14136,38 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
-cf_add_libs="$cf_pkgconfig_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -11646,12 +14184,12 @@ else
test -n "$verbose" && echo " ...before $LIBS" 1>&6
-echo "${as_me:-configure}:11649: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:14187: testing ...before $LIBS ..." 1>&5
LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's% % %g'`
test -n "$verbose" && echo " ...after $LIBS" 1>&6
-echo "${as_me:-configure}:11654: testing ...after $LIBS ..." 1>&5
+echo "${as_me:-configure}:14192: testing ...after $LIBS ..." 1>&5
fi
@@ -11671,7 +14209,7 @@ else
test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
-echo "${as_me:-configure}:11674: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14212: testing checking additions to CFLAGS ..." 1>&5
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
@@ -11684,11 +14222,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $X_CFLAGS
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -11696,20 +14234,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -11718,17 +14262,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -11742,34 +14294,40 @@ done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
-echo "${as_me:-configure}:11745: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:14297: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
- CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-echo "${as_me:-configure}:11753: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:14307: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-echo "${as_me:-configure}:11761: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:14317: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 11768 "configure"
+#line 14326 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello world");
;
@@ -11777,16 +14335,16 @@ printf("Hello world");
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11780: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14338: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11783: \$? = $ac_status" >&5
+ echo "$as_me:14341: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11786: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14344: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11789: \$? = $ac_status" >&5
+ echo "$as_me:14347: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -11794,12 +14352,12 @@ else
cat conftest.$ac_ext >&5
test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
-echo "${as_me:-configure}:11797: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:14355: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
-echo "${as_me:-configure}:11802: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:14360: testing but keeping change to \$CPPFLAGS ..." 1>&5
fi
CFLAGS="$cf_check_flags"
@@ -11807,53 +14365,53 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
- echo "$as_me:11810: checking for XOpenDisplay" >&5
+ echo "$as_me:14368: checking for XOpenDisplay" >&5
echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
if test "${ac_cv_func_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11816 "configure"
+#line 14374 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char XOpenDisplay (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define XOpenDisplay autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef XOpenDisplay
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char XOpenDisplay ();
-char (*f) ();
+char XOpenDisplay (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
-choke me
-#else
-f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for XOpenDisplay
#endif
+ return XOpenDisplay ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11847: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14405: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11850: \$? = $ac_status" >&5
+ echo "$as_me:14408: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11853: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14411: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11856: \$? = $ac_status" >&5
+ echo "$as_me:14414: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_XOpenDisplay=yes
else
@@ -11863,13 +14421,13 @@ ac_cv_func_XOpenDisplay=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11866: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:14424: result: $ac_cv_func_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
if test $ac_cv_func_XOpenDisplay = yes; then
:
else
- echo "$as_me:11872: checking for XOpenDisplay in -lX11" >&5
+ echo "$as_me:14430: checking for XOpenDisplay in -lX11" >&5
echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11877,7 +14435,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 11880 "configure"
+#line 14438 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -11888,7 +14446,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char XOpenDisplay ();
int
-main ()
+main (void)
{
XOpenDisplay ();
;
@@ -11896,16 +14454,16 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11899: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14457: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11902: \$? = $ac_status" >&5
+ echo "$as_me:14460: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11905: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14463: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11908: \$? = $ac_status" >&5
+ echo "$as_me:14466: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_X11_XOpenDisplay=yes
else
@@ -11916,23 +14474,23 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:11919: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:14477: result: $ac_cv_lib_X11_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
if test $ac_cv_lib_X11_XOpenDisplay = yes; then
-cf_add_libs="-lX11"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -11940,53 +14498,53 @@ fi
fi
- echo "$as_me:11943: checking for XtAppInitialize" >&5
+ echo "$as_me:14501: checking for XtAppInitialize" >&5
echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
if test "${ac_cv_func_XtAppInitialize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 11949 "configure"
+#line 14507 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char XtAppInitialize (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define XtAppInitialize autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef XtAppInitialize
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char XtAppInitialize ();
-char (*f) ();
+char XtAppInitialize (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
-choke me
-#else
-f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for XtAppInitialize
#endif
+ return XtAppInitialize ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11980: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14538: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:11983: \$? = $ac_status" >&5
+ echo "$as_me:14541: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:11986: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14544: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:11989: \$? = $ac_status" >&5
+ echo "$as_me:14547: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_XtAppInitialize=yes
else
@@ -11996,13 +14554,13 @@ ac_cv_func_XtAppInitialize=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:11999: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:14557: result: $ac_cv_func_XtAppInitialize" >&5
echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
if test $ac_cv_func_XtAppInitialize = yes; then
:
else
- echo "$as_me:12005: checking for XtAppInitialize in -lXt" >&5
+ echo "$as_me:14563: checking for XtAppInitialize in -lXt" >&5
echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12010,7 +14568,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12013 "configure"
+#line 14571 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12021,7 +14579,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char XtAppInitialize ();
int
-main ()
+main (void)
{
XtAppInitialize ();
;
@@ -12029,16 +14587,16 @@ XtAppInitialize ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12032: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14590: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12035: \$? = $ac_status" >&5
+ echo "$as_me:14593: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12038: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14596: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12041: \$? = $ac_status" >&5
+ echo "$as_me:14599: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_Xt_XtAppInitialize=yes
else
@@ -12049,7 +14607,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12052: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:14610: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
@@ -12066,7 +14624,7 @@ fi
fi
if test $cf_have_X_LIBS = no ; then
- { echo "$as_me:12069: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+ { echo "$as_me:14627: WARNING: Unable to successfully link X Toolkit library (-lXt) with
test program. You will have to check and add the proper libraries by hand
to makefile." >&5
echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
@@ -12084,24 +14642,43 @@ for cf_path in default \
/usr/local
do
if test -z "$cf_x_athena_inc" ; then
- cf_save="$CPPFLAGS"
+
+cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
+cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
+cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
+LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
+for cf_X_CFLAGS in $X_CFLAGS
+do
+ case "x$cf_X_CFLAGS" in
+ x-[IUD]*)
+ CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS $cf_X_CFLAGS"
+ ;;
+ esac
+done
+
cf_test=X11/$cf_x_athena_root/SimpleMenu.h
if test $cf_path != default ; then
- CPPFLAGS="$cf_save -I$cf_path/include"
- echo "$as_me:12091: checking for $cf_test in $cf_path" >&5
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
+
+ echo "$as_me:14668: checking for $cf_test in $cf_path" >&5
echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
else
- echo "$as_me:12094: checking for $cf_test" >&5
+ echo "$as_me:14671: checking for $cf_test" >&5
echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
fi
cat >conftest.$ac_ext <<_ACEOF
-#line 12098 "configure"
+#line 14675 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
#include <$cf_test>
int
-main ()
+main (void)
{
;
@@ -12109,16 +14686,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12112: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14689: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:12115: \$? = $ac_status" >&5
+ echo "$as_me:14692: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:12118: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14695: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12121: \$? = $ac_status" >&5
+ echo "$as_me:14698: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -12127,22 +14704,29 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:12130: result: $cf_result" >&5
+ echo "$as_me:14707: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
+
+LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
+CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
+CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
+
if test "$cf_result" = yes ; then
- cf_x_athena_inc=$cf_path
+ test "$cf_path" = default && cf_x_athena_inc=default
+ test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
break
- else
- CPPFLAGS="$cf_save"
fi
fi
done
if test -z "$cf_x_athena_inc" ; then
- { echo "$as_me:12142: WARNING: Unable to successfully find Athena header files with test program" >&5
-echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
+ { echo "$as_me:14723: WARNING: Unable to find Athena header files" >&5
+echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
elif test "$cf_x_athena_inc" != default ; then
- CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
+
fi
cf_x_athena_root=$cf_x_athena
@@ -12164,59 +14748,54 @@ do
"-l$cf_lib -lXpm -lXmu" \
"-l${cf_lib}_s -lXmu_s"
do
- if test -z "$cf_x_athena_lib" ; then
- cf_save="$LIBS"
- cf_test=XawSimpleMenuAddGlobalActions
- if test $cf_path != default ; then
-
-cf_add_libs="-L$cf_path/lib $cf_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+ test -n "$cf_x_athena_lib" && break
+
+cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
+cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
+cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
+LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
+for cf_X_CFLAGS in $X_CFLAGS
do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
- cf_add_1lib=
- break
- fi
- done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ case "x$cf_X_CFLAGS" in
+ x-[IUD]*)
+ CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS $cf_X_CFLAGS"
+ ;;
+ esac
done
-LIBS="$cf_add_libs"
- echo "$as_me:12188: checking for $cf_libs in $cf_path" >&5
-echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
- else
-
-cf_add_libs="$cf_libs"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+ cf_test=XawSimpleMenuAddGlobalActions
+ test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
- echo "$as_me:12208: checking for $cf_test in $cf_libs" >&5
+ echo "$as_me:14788: checking for $cf_test in $cf_libs" >&5
echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
- fi
- cat >conftest.$ac_ext <<_ACEOF
-#line 12212 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 14791 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
#include <X11/$cf_x_athena_root/SimpleMenu.h>
int
-main ()
+main (void)
{
$cf_test((XtAppContext) 0)
@@ -12225,16 +14804,16 @@ $cf_test((XtAppContext) 0)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12228: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14807: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12231: \$? = $ac_status" >&5
+ echo "$as_me:14810: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12234: \"$ac_try\"") >&5
+ { (eval echo "$as_me:14813: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12237: \$? = $ac_status" >&5
+ echo "$as_me:14816: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -12243,13 +14822,16 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- echo "$as_me:12246: result: $cf_result" >&5
+ echo "$as_me:14825: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
- if test "$cf_result" = yes ; then
- cf_x_athena_lib="$cf_libs"
- break
- fi
- LIBS="$cf_save"
+
+LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
+CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
+CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
+
+ if test "$cf_result" = yes ; then
+ cf_x_athena_lib="$cf_libs"
+ break
fi
done # cf_libs
test -n "$cf_x_athena_lib" && break
@@ -12257,11 +14839,27 @@ echo "${ECHO_T}$cf_result" >&6
done
if test -z "$cf_x_athena_lib" ; then
- { { echo "$as_me:12260: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+ { { echo "$as_me:14842: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
{ (exit 1); exit 1; }; }
fi
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
cat >>confdefs.h <<EOF
@@ -12275,7 +14873,7 @@ if test -n "$ac_tool_prefix"; then
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:12278: checking for $ac_word" >&5
+echo "$as_me:14876: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12290,7 +14888,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
-echo "$as_me:12293: found $ac_dir/$ac_word" >&5
+echo "$as_me:14891: found $ac_dir/$ac_word" >&5
break
done
@@ -12298,10 +14896,10 @@ fi
fi
XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
if test -n "$XCURSES_CONFIG"; then
- echo "$as_me:12301: result: $XCURSES_CONFIG" >&5
+ echo "$as_me:14899: result: $XCURSES_CONFIG" >&5
echo "${ECHO_T}$XCURSES_CONFIG" >&6
else
- echo "$as_me:12304: result: no" >&5
+ echo "$as_me:14902: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -12314,7 +14912,7 @@ if test -z "$XCURSES_CONFIG"; then
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:12317: checking for $ac_word" >&5
+echo "$as_me:14915: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12329,7 +14927,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
-echo "$as_me:12332: found $ac_dir/$ac_word" >&5
+echo "$as_me:14930: found $ac_dir/$ac_word" >&5
break
done
@@ -12337,10 +14935,10 @@ fi
fi
ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
if test -n "$ac_ct_XCURSES_CONFIG"; then
- echo "$as_me:12340: result: $ac_ct_XCURSES_CONFIG" >&5
+ echo "$as_me:14938: result: $ac_ct_XCURSES_CONFIG" >&5
echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
else
- echo "$as_me:12343: result: no" >&5
+ echo "$as_me:14941: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -12353,21 +14951,117 @@ fi
if test "$XCURSES_CONFIG" != none ; then
-CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
-cf_add_libs="`$XCURSES_CONFIG --libs`"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
+for cf_add_cflags in `$XCURSES_CONFIG --cflags`
do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
@@ -12379,7 +15073,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6
-echo "${as_me:-configure}:12382: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:15076: testing checking additions to CFLAGS ..." 1>&5
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
@@ -12392,11 +15086,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in $X_CFLAGS
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -12404,20 +15098,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -12426,17 +15126,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -12450,34 +15158,40 @@ done
if test -n "$cf_new_cflags" ; then
test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6
-echo "${as_me:-configure}:12453: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:15161: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
- CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6
-echo "${as_me:-configure}:12461: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:15171: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
-echo "${as_me:-configure}:12469: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:15181: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat >conftest.$ac_ext <<_ACEOF
-#line 12476 "configure"
+#line 15190 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello world");
;
@@ -12485,16 +15199,16 @@ printf("Hello world");
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12488: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15202: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12491: \$? = $ac_status" >&5
+ echo "$as_me:15205: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12494: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15208: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12497: \$? = $ac_status" >&5
+ echo "$as_me:15211: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -12502,12 +15216,12 @@ else
cat conftest.$ac_ext >&5
test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6
-echo "${as_me:-configure}:12505: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:15219: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5
if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6
-echo "${as_me:-configure}:12510: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:15224: testing but keeping change to \$CPPFLAGS ..." 1>&5
fi
CFLAGS="$cf_check_flags"
@@ -12515,7 +15229,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:12518: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:15232: checking for XOpenDisplay in -lX11" >&5
echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12523,7 +15237,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12526 "configure"
+#line 15240 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12534,7 +15248,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char XOpenDisplay ();
int
-main ()
+main (void)
{
XOpenDisplay ();
;
@@ -12542,16 +15256,16 @@ XOpenDisplay ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12545: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15259: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12548: \$? = $ac_status" >&5
+ echo "$as_me:15262: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12551: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15265: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12554: \$? = $ac_status" >&5
+ echo "$as_me:15268: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_X11_XOpenDisplay=yes
else
@@ -12562,59 +15276,59 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12565: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:15279: result: $ac_cv_lib_X11_XOpenDisplay" >&5
echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
if test $ac_cv_lib_X11_XOpenDisplay = yes; then
-cf_add_libs="-lX11"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
fi
-echo "$as_me:12587: checking for XCurses library" >&5
+echo "$as_me:15301: checking for XCurses library" >&5
echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
if test "${cf_cv_lib_XCurses+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-cf_add_libs="-lXCurses"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
cat >conftest.$ac_ext <<_ACEOF
-#line 12610 "configure"
+#line 15324 "configure"
#include "confdefs.h"
#include <xcurses.h>
char *XCursesProgramName = "test";
int
-main ()
+main (void)
{
XCursesExit();
;
@@ -12622,16 +15336,16 @@ XCursesExit();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12625: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15339: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12628: \$? = $ac_status" >&5
+ echo "$as_me:15342: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12631: \"$ac_try\"") >&5
+ { (eval echo "$as_me:15345: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12634: \$? = $ac_status" >&5
+ echo "$as_me:15348: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_lib_XCurses=yes
else
@@ -12642,7 +15356,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:12645: result: $cf_cv_lib_XCurses" >&5
+echo "$as_me:15359: result: $cf_cv_lib_XCurses" >&5
echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
fi
@@ -12657,23 +15371,23 @@ cat >>confdefs.h <<\EOF
#define XCURSES 1
EOF
- echo "$as_me:12660: checking for xcurses.h" >&5
+ echo "$as_me:15374: checking for xcurses.h" >&5
echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
if test "${ac_cv_header_xcurses_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12666 "configure"
+#line 15380 "configure"
#include "confdefs.h"
#include <xcurses.h>
_ACEOF
-if { (eval echo "$as_me:12670: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:15384: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:12676: \$? = $ac_status" >&5
+ echo "$as_me:15390: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12692,7 +15406,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:12695: result: $ac_cv_header_xcurses_h" >&5
+echo "$as_me:15409: result: $ac_cv_header_xcurses_h" >&5
echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
if test $ac_cv_header_xcurses_h = yes; then
@@ -12703,87 +15417,571 @@ EOF
fi
else
- { { echo "$as_me:12706: error: Cannot link with XCurses" >&5
+ { { echo "$as_me:15420: error: Cannot link with XCurses" >&5
echo "$as_me: error: Cannot link with XCurses" >&2;}
{ (exit 1); exit 1; }; }
fi
;;
+(*)
+ { { echo "$as_me:15427: error: unexpected screen-value: $cf_cv_screen" >&5
+echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
esac
-case $cf_cv_screen in
-curses|curses_*)
-
-echo "$as_me:12717: checking for NetBSD form.h" >&5
-echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
-if test "${cf_cv_netbsd_form_h+set}" = set; then
+: ${cf_nculib_root:=$cf_cv_screen}
+as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
+echo "$as_me:15435: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
-
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_nculib_root $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12724 "configure"
+#line 15443 "configure"
#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <form.h>
-
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _nc_init_pthreads ();
int
-main ()
+main (void)
{
+_nc_init_pthreads ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15462: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:15465: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:15468: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:15471: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:15482: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ cf_cv_ncurses_pthreads=yes
+else
+ cf_cv_ncurses_pthreads=no
+fi
- FORM *form;
- int y = current_field(form)->cursor_ypos;
- int x = current_field(form)->cursor_xpos;
+if test "$cf_cv_ncurses_pthreads" = yes
+then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+fi
+
+case $cf_cv_screen in
+(ncurses*)
+ cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
+ ;;
+esac
+
+echo "$as_me:15517: checking for X11 rgb file" >&5
+echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
+
+# Check whether --with-x11-rgb or --without-x11-rgb was given.
+if test "${with_x11_rgb+set}" = set; then
+ withval="$with_x11_rgb"
+ RGB_PATH=$withval
+else
+ RGB_PATH=auto
+fi;
+
+if test "x$RGB_PATH" = xauto
+then
+ RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
+ for cf_path in \
+ /opt/local/share/X11/rgb.txt \
+ /opt/X11/share/X11/rgb.txt \
+ /usr/share/X11/rgb.txt \
+ /usr/X11/share/X11/rgb.txt \
+ /usr/X11/lib/X11/rgb.txt \
+ /usr/lib/X11/rgb.txt \
+ /etc/X11/rgb.txt \
+ /usr/pkg/lib/X11/rgb.txt \
+ /usr/X11R7/lib/X11/rgb.txt \
+ /usr/X11R6/lib/X11/rgb.txt \
+ /usr/X11R5/lib/X11/rgb.txt \
+ /usr/X11R4/lib/X11/rgb.txt \
+ /usr/local/lib/X11/rgb.txt \
+ /usr/local/share/X11/rgb.txt \
+ /usr/lib64/X11/rgb.txt
+ do
+ if test -f "$cf_path" ; then
+ RGB_PATH="$cf_path"
+ break
+ fi
+ done
+else
+ cf_path=$RGB_PATH
+
+if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
+else
+ cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$cf_path" in
+(.\$\(*\)*|.\'*\'*)
+ ;;
+(..|./*|.\\*)
+ ;;
+(.[a-zA-Z]:[\\/]*) # OS/2 EMX
+ ;;
+(.\${*prefix}*|.\${*dir}*)
+ eval cf_path="$cf_path"
+ case ".$cf_path" in
+ (.NONE/*)
+ cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;;
+(.no|.NONE/*)
+ cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+(*)
+ { { echo "$as_me:15581: error: expected a pathname, not \"$cf_path\"" >&5
+echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+fi
+
+echo "$as_me:15589: result: $RGB_PATH" >&5
+echo "${ECHO_T}$RGB_PATH" >&6
+
+cat >>confdefs.h <<EOF
+#define RGB_PATH "$cf_path"
+EOF
+
+no_x11_rgb=
+if test "$RGB_PATH" = no
+then
+ no_x11_rgb="#"
+fi
+
+cf_curses_headers=
+
+case $cf_cv_screen in
+(pdcurses)
+ cf_default_panel=no
+ cf_default_form=no
+ cf_default_menu=no
+ cf_default_tinfo=no
+ ;;
+(xcurses|bsdcurses)
+ cf_default_panel=no
+ cf_default_form=no
+ cf_default_menu=no
+ cf_default_tinfo=yes
+ ;;
+(*)
+ cf_default_panel=yes
+ cf_default_form=yes
+ cf_default_menu=yes
+ cf_default_tinfo=yes
+ case $cf_cv_screen in
+ (ncurses*)
+ cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
+ ;;
+ esac
+ ;;
+esac
+
+echo "$as_me:15630: checking if you want to check for panel functions" >&5
+echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
+
+# Check whether --enable-panel or --disable-panel was given.
+if test "${enable_panel+set}" = set; then
+ enableval="$enable_panel"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ cf_enable_panel=no
+ else
+ cf_enable_panel=$cf_default_panel
+ fi
+else
+ enableval=yes
+ cf_enable_panel=$cf_default_panel
+
+fi;
+echo "$as_me:15647: result: $cf_enable_panel" >&5
+echo "${ECHO_T}$cf_enable_panel" >&6
+if test $cf_enable_panel = yes
+then
+
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+ :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+ echo "$as_me:15658: checking pkg-config for panel$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
+ if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
+ echo "$as_me:15661: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+ echo "$as_me:15664: checking if the panel$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs panel$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 15785 "configure"
+#include "confdefs.h"
+#include <panel.h>
+int
+main (void)
+{
+(void) new_panel ( 0 );
;
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12743: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15797: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12746: \$? = $ac_status" >&5
+ echo "$as_me:15800: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:12749: \"$ac_try\"") >&5
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:15803: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12752: \$? = $ac_status" >&5
+ echo "$as_me:15806: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_cv_netbsd_form_h=yes
-
+ if test "$cross_compiling" = yes; then
+ cf_have_curses_lib=maybe
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 15812 "configure"
+#include "confdefs.h"
+#include <panel.h>
+ int main(void)
+ { (void) new_panel ( 0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15819: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:15822: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:15824: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:15827: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_have_curses_lib=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_cv_netbsd_form_h=no
+cf_have_curses_lib=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ echo "$as_me:15844: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+ test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+ if test "$cf_have_curses_lib" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ else
+
+cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
+ fi
+ fi
fi
-echo "$as_me:12764: result: $cf_cv_netbsd_form_h" >&5
-echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
+if test "$cf_have_curses_lib" = no; then
+ as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
+echo "$as_me:15864: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpanel$cf_cv_libtype $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 15872 "configure"
+#include "confdefs.h"
-test "$cf_cv_netbsd_form_h" = yes &&
-cat >>confdefs.h <<\EOF
-#define HAVE_NETBSD_FORM_H 1
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char new_panel ();
+int
+main (void)
+{
+new_panel ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15891: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:15894: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:15897: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:15900: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:15911: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+
+cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lpanel$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
EOF
-echo "$as_me:12772: checking for NetBSD menu.h" >&5
+fi
+
+fi
+
+ cf_curses_headers="$cf_curses_headers panel.h"
+fi
+
+echo "$as_me:15944: checking if you want to check for menu functions" >&5
+echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
+
+# Check whether --enable-menu or --disable-menu was given.
+if test "${enable_menu+set}" = set; then
+ enableval="$enable_menu"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ cf_enable_menu=no
+ else
+ cf_enable_menu=$cf_default_menu
+ fi
+else
+ enableval=yes
+ cf_enable_menu=$cf_default_menu
+
+fi;
+echo "$as_me:15961: result: $cf_enable_menu" >&5
+echo "${ECHO_T}$cf_enable_menu" >&6
+if test $cf_enable_menu = yes
+then
+ case $cf_cv_screen in
+ (ncurses*)
+ ;;
+ (curses*)
+
+echo "$as_me:15970: checking for NetBSD menu.h" >&5
echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
if test "${cf_cv_netbsd_menu_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 12779 "configure"
+#line 15977 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <menu.h>
int
-main ()
+main (void)
{
MENU *menu;
@@ -12794,16 +15992,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12797: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15995: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:12800: \$? = $ac_status" >&5
+ echo "$as_me:15998: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:12803: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16001: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12806: \$? = $ac_status" >&5
+ echo "$as_me:16004: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_netbsd_menu_h=yes
@@ -12815,7 +16013,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:12818: result: $cf_cv_netbsd_menu_h" >&5
+echo "$as_me:16016: result: $cf_cv_netbsd_menu_h" >&5
echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
test "$cf_cv_netbsd_menu_h" = yes &&
@@ -12823,31 +16021,230 @@ cat >>confdefs.h <<\EOF
#define HAVE_NETBSD_MENU_H 1
EOF
+ ;;
+ esac
+
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+ :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+ echo "$as_me:16033: checking pkg-config for menu$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
+ if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
+ echo "$as_me:16036: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+ echo "$as_me:16039: checking if the menu$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
;;
-ncursesw)
- cf_cv_libtype=w
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
;;
esac
+done
-case $cf_cv_screen in #(vi
-pdcurses) #(vi
- ;;
-*)
- # look for curses-related libraries
- : ${cf_panel_lib:=panel}
- : ${cf_menu_lib:=menu}
- : ${cf_form_lib:=form}
-
-as_ac_Lib=`echo "ac_cv_lib_$cf_panel_lib$cf_cv_libtype''_new_panel" | $as_tr_sh`
-echo "$as_me:12842: checking for new_panel in -l$cf_panel_lib$cf_cv_libtype" >&5
-echo $ECHO_N "checking for new_panel in -l$cf_panel_lib$cf_cv_libtype... $ECHO_C" >&6
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs menu$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16160 "configure"
+#include "confdefs.h"
+#include <menu.h>
+int
+main (void)
+{
+(void) menu_driver ( 0,0 );
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:16172: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16175: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:16178: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16181: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ if test "$cross_compiling" = yes; then
+ cf_have_curses_lib=maybe
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16187 "configure"
+#include "confdefs.h"
+#include <menu.h>
+ int main(void)
+ { (void) menu_driver ( 0,0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:16194: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16197: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:16199: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16202: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_have_curses_lib=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ echo "$as_me:16219: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+ test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+ if test "$cf_have_curses_lib" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ else
+
+cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
+
+ fi
+ fi
+fi
+if test "$cf_have_curses_lib" = no; then
+ as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
+echo "$as_me:16239: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
+LIBS="-lmenu$cf_cv_libtype $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12850 "configure"
+#line 16247 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12856,26 +16253,26 @@ extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char new_panel ();
+char menu_driver ();
int
-main ()
+main (void)
{
-new_panel ();
+menu_driver ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12869: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16266: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12872: \$? = $ac_status" >&5
+ echo "$as_me:16269: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12875: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16272: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12878: \$? = $ac_status" >&5
+ echo "$as_me:16275: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -12886,86 +16283,344 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:12889: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16286: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIB$cf_panel_lib$cf_cv_libtype" | $as_tr_cpp` 1
+
+cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lmenu$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
EOF
- LIBS="-l$cf_panel_lib$cf_cv_libtype $LIBS"
+fi
+
+fi
+ cf_curses_headers="$cf_curses_headers menu.h"
fi
-as_ac_Lib=`echo "ac_cv_lib_$cf_menu_lib$cf_cv_libtype''_menu_driver" | $as_tr_sh`
-echo "$as_me:12901: checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype" >&5
-echo $ECHO_N "checking for menu_driver in -l$cf_menu_lib$cf_cv_libtype... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+echo "$as_me:16319: checking if you want to check for form functions" >&5
+echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
+
+# Check whether --enable-form or --disable-form was given.
+if test "${enable_form+set}" = set; then
+ enableval="$enable_form"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+ cf_enable_form=no
+ else
+ cf_enable_form=$cf_default_form
+ fi
+else
+ enableval=yes
+ cf_enable_form=$cf_default_form
+
+fi;
+echo "$as_me:16336: result: $cf_enable_form" >&5
+echo "${ECHO_T}$cf_enable_form" >&6
+if test $cf_enable_form = yes
+then
+ case $cf_cv_screen in
+ (ncurses*)
+ ;;
+ (curses*)
+
+echo "$as_me:16345: checking for NetBSD form.h" >&5
+echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
+if test "${cf_cv_netbsd_form_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
+
cat >conftest.$ac_ext <<_ACEOF
-#line 12909 "configure"
+#line 16352 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char menu_driver ();
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <form.h>
+
int
-main ()
+main (void)
{
-menu_driver ();
+
+ FORM *form;
+ int y = current_field(form)->cursor_ypos;
+ int x = current_field(form)->cursor_xpos;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:16371: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:16374: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:16377: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16380: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_netbsd_form_h=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_netbsd_form_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:16392: result: $cf_cv_netbsd_form_h" >&5
+echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
+
+test "$cf_cv_netbsd_form_h" = yes &&
+cat >>confdefs.h <<\EOF
+#define HAVE_NETBSD_FORM_H 1
+EOF
+
+ ;;
+ esac
+
+cf_have_curses_lib=no
+
+: ${NCURSES_CONFIG_PKG:=none}
+if test "x${NCURSES_CONFIG_PKG}" = xnone; then
+ :
+elif test "x${PKG_CONFIG:=none}" != xnone; then
+ echo "$as_me:16409: checking pkg-config for form$cf_cv_libtype" >&5
+echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
+ if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
+ echo "$as_me:16412: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+ echo "$as_me:16415: checking if the form$cf_cv_libtype package files work" >&5
+echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ cf_save_LIBS="$LIBS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
+do
+case $cf_fix_cppflags in
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ (*$cf_add_cflags)
+ ;;
+ (*)
+ case $cf_add_cflags in
+ (-D*)
+ cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+
+ ;;
+ esac
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
+ ;;
+ esac
+ ;;
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
+fi
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in `$PKG_CONFIG --libs form$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16536 "configure"
+#include "confdefs.h"
+#include <form.h>
+int
+main (void)
+{
+(void) form_driver ( 0,0 );
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12928: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16548: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12931: \$? = $ac_status" >&5
+ echo "$as_me:16551: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12934: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16554: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12937: \$? = $ac_status" >&5
+ echo "$as_me:16557: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- eval "$as_ac_Lib=yes"
+ if test "$cross_compiling" = yes; then
+ cf_have_curses_lib=maybe
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 16563 "configure"
+#include "confdefs.h"
+#include <form.h>
+ int main(void)
+ { (void) form_driver ( 0,0 ); return 0; }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:16570: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:16573: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:16575: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:16578: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_have_curses_lib=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_curses_lib=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-eval "$as_ac_Lib=no"
+cf_have_curses_lib=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:12948: result: `eval echo '${'$as_ac_Lib'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
-if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIB$cf_menu_lib$cf_cv_libtype" | $as_tr_cpp` 1
-EOF
+ echo "$as_me:16595: result: $cf_have_curses_lib" >&5
+echo "${ECHO_T}$cf_have_curses_lib" >&6
+ test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
+ if test "$cf_have_curses_lib" != "yes"
+ then
+ CPPFLAGS="$cf_save_CPPFLAGS"
+ LIBS="$cf_save_LIBS"
+ else
- LIBS="-l$cf_menu_lib$cf_cv_libtype $LIBS"
+cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-fi
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
+EOF
-as_ac_Lib=`echo "ac_cv_lib_$cf_form_lib$cf_cv_libtype''_form_driver" | $as_tr_sh`
-echo "$as_me:12960: checking for form_driver in -l$cf_form_lib$cf_cv_libtype" >&5
-echo $ECHO_N "checking for form_driver in -l$cf_form_lib$cf_cv_libtype... $ECHO_C" >&6
+ fi
+ fi
+fi
+if test "$cf_have_curses_lib" = no; then
+ as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
+echo "$as_me:16615: checking for form_driver in -lform$cf_cv_libtype" >&5
+echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
if eval "test \"\${$as_ac_Lib+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
+LIBS="-lform$cf_cv_libtype $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 12968 "configure"
+#line 16623 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -12976,7 +16631,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char form_driver ();
int
-main ()
+main (void)
{
form_driver ();
;
@@ -12984,16 +16639,16 @@ form_driver ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12987: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16642: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:12990: \$? = $ac_status" >&5
+ echo "$as_me:16645: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:12993: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16648: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:12996: \$? = $ac_status" >&5
+ echo "$as_me:16651: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_Lib=yes"
else
@@ -13004,46 +16659,61 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:13007: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:16662: result: `eval echo '${'$as_ac_Lib'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
if test `eval echo '${'$as_ac_Lib'}'` = yes; then
- cat >>confdefs.h <<EOF
-#define `echo "HAVE_LIB$cf_form_lib$cf_cv_libtype" | $as_tr_cpp` 1
+
+cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lform$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+
+ cat >>confdefs.h <<EOF
+#define $cf_upper 1
EOF
- LIBS="-l$cf_form_lib$cf_cv_libtype $LIBS"
+fi
fi
- # look for curses-related headers
+ cf_curses_headers="$cf_curses_headers form.h"
+fi
-for ac_header in \
- nc_alloc.h \
- nomacros.h \
- form.h \
- menu.h \
- panel.h \
- term_entry.h \
+# look for curses-related headers
+for ac_header in $cf_curses_headers
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13030: checking for $ac_header" >&5
+echo "$as_me:16700: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13036 "configure"
+#line 16706 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:13040: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16710: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:13046: \$? = $ac_status" >&5
+ echo "$as_me:16716: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13062,7 +16732,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:13065: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16735: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -13072,16 +16742,13 @@ EOF
fi
done
- ;;
-esac
-
-echo "$as_me:13078: checking for ANSI C header files" >&5
+echo "$as_me:16745: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13084 "configure"
+#line 16751 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -13089,13 +16756,13 @@ else
#include <float.h>
_ACEOF
-if { (eval echo "$as_me:13092: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16759: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:13098: \$? = $ac_status" >&5
+ echo "$as_me:16765: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13117,7 +16784,7 @@ rm -f conftest.err conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line 13120 "configure"
+#line 16787 "configure"
#include "confdefs.h"
#include <string.h>
@@ -13135,7 +16802,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat >conftest.$ac_ext <<_ACEOF
-#line 13138 "configure"
+#line 16805 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -13156,7 +16823,7 @@ if test $ac_cv_header_stdc = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13159 "configure"
+#line 16826 "configure"
#include "confdefs.h"
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
@@ -13171,7 +16838,7 @@ else
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
-main ()
+main (void)
{
int i;
for (i = 0; i < 256; i++)
@@ -13182,15 +16849,15 @@ main ()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13185: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16852: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13188: \$? = $ac_status" >&5
+ echo "$as_me:16855: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:13190: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16857: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13193: \$? = $ac_status" >&5
+ echo "$as_me:16860: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -13203,7 +16870,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
-echo "$as_me:13206: result: $ac_cv_header_stdc" >&5
+echo "$as_me:16873: result: $ac_cv_header_stdc" >&5
echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
@@ -13213,20 +16880,20 @@ EOF
fi
-echo "$as_me:13216: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:16883: checking whether time.h and sys/time.h may both be included" >&5
echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13222 "configure"
+#line 16889 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int
-main ()
+main (void)
{
if ((struct tm *) 0)
return 0;
@@ -13235,16 +16902,16 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13238: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16905: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13241: \$? = $ac_status" >&5
+ echo "$as_me:16908: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13244: \"$ac_try\"") >&5
+ { (eval echo "$as_me:16911: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13247: \$? = $ac_status" >&5
+ echo "$as_me:16914: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_header_time=yes
else
@@ -13254,7 +16921,7 @@ ac_cv_header_time=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:13257: result: $ac_cv_header_time" >&5
+echo "$as_me:16924: result: $ac_cv_header_time" >&5
echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then
@@ -13269,6 +16936,7 @@ getopt.h \
locale.h \
math.h \
stdarg.h \
+stdint.h \
sys/ioctl.h \
sys/select.h \
sys/time.h \
@@ -13277,23 +16945,23 @@ unistd.h \
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13280: checking for $ac_header" >&5
+echo "$as_me:16948: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13286 "configure"
+#line 16954 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:13290: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16958: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:13296: \$? = $ac_status" >&5
+ echo "$as_me:16964: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13312,7 +16980,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:13315: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:16983: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -13325,23 +16993,23 @@ done
for ac_header in unistd.h getopt.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13328: checking for $ac_header" >&5
+echo "$as_me:16996: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13334 "configure"
+#line 17002 "configure"
#include "confdefs.h"
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:13338: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17006: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:13344: \$? = $ac_status" >&5
+ echo "$as_me:17012: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13360,7 +17028,7 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:13363: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:17031: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -13370,7 +17038,7 @@ EOF
fi
done
-echo "$as_me:13373: checking for header declaring getopt variables" >&5
+echo "$as_me:17041: checking for header declaring getopt variables" >&5
echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
if test "${cf_cv_getopt_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13380,12 +17048,12 @@ cf_cv_getopt_header=none
for cf_header in stdio.h stdlib.h unistd.h getopt.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13383 "configure"
+#line 17051 "configure"
#include "confdefs.h"
#include <$cf_header>
int
-main ()
+main (void)
{
int x = optind; char *y = optarg
;
@@ -13393,16 +17061,16 @@ int x = optind; char *y = optarg
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13396: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17064: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13399: \$? = $ac_status" >&5
+ echo "$as_me:17067: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13402: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17070: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13405: \$? = $ac_status" >&5
+ echo "$as_me:17073: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_getopt_header=$cf_header
break
@@ -13414,7 +17082,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:13417: result: $cf_cv_getopt_header" >&5
+echo "$as_me:17085: result: $cf_cv_getopt_header" >&5
echo "${ECHO_T}$cf_cv_getopt_header" >&6
if test $cf_cv_getopt_header != none ; then
@@ -13434,56 +17102,58 @@ fi
for ac_func in \
getopt \
gettimeofday \
+strstr \
+tsearch \
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:13440: checking for $ac_func" >&5
+echo "$as_me:17110: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13446 "configure"
+#line 17116 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define $ac_func autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef $ac_func
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func ();
-char (*f) ();
+char $ac_func (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for $ac_func
#endif
+ return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13477: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17147: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13480: \$? = $ac_status" >&5
+ echo "$as_me:17150: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13483: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17153: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13486: \$? = $ac_status" >&5
+ echo "$as_me:17156: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
@@ -13493,7 +17163,7 @@ eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:13496: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:17166: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -13503,8 +17173,122 @@ EOF
fi
done
+# use a compile-check to work with ncurses*-config and subdirectory includes
+echo "$as_me:17177: checking if we can use termcap.h" >&5
+echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
+if test "${cf_cv_have_termcap_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 17184 "configure"
+#include "confdefs.h"
+
+#include <curses.h>
+#ifdef NCURSES_VERSION
+#undef NCURSES_VERSION
+#endif
+#include <termcap.h>
+#ifndef NCURSES_VERSION
+#error wrong header
+#endif
+
+int
+main (void)
+{
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:17205: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:17208: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:17211: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:17214: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_have_termcap_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_have_termcap_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:17224: result: $cf_cv_have_termcap_h" >&5
+echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
+if test "x$cf_cv_have_termcap_h" = xyes
+then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_TERMCAP_H 1
+EOF
+
+else
+echo "$as_me:17234: checking if we can use ncurses/termcap.h" >&5
+echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
+if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 17241 "configure"
+#include "confdefs.h"
+
+#include <ncurses/curses.h>
+#ifdef NCURSES_VERSION
+#undef NCURSES_VERSION
+#endif
+#include <ncurses/termcap.h>
+#ifndef NCURSES_VERSION
+#error wrong header
+#endif
+
+int
+main (void)
+{
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:17262: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:17265: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:17268: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:17271: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_have_ncurses_termcap_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_have_ncurses_termcap_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:17281: result: $cf_cv_have_ncurses_termcap_h" >&5
+echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
+test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
+cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERMCAP_H 1
+EOF
+
+fi
+
if test "x$ac_cv_func_getopt" = xno; then
- { { echo "$as_me:13507: error: getopt is required for building programs" >&5
+ { { echo "$as_me:17291: error: getopt is required for building programs" >&5
echo "$as_me: error: getopt is required for building programs" >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -13523,53 +17307,53 @@ wcstombs \
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:13526: checking for $ac_func" >&5
+echo "$as_me:17310: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 13532 "configure"
+#line 17316 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
+#define $ac_func autoconf_temporary
+#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */
+#undef $ac_func
+
#ifdef __cplusplus
extern "C"
#endif
+
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func ();
-char (*f) ();
+char $ac_func (void);
int
-main ()
+main (void)
{
-/* The GNU C library defines this for functions which it implements
+
+/* The GNU C library defines stubs for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
+#error found stub for $ac_func
#endif
+ return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13563: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17347: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13566: \$? = $ac_status" >&5
+ echo "$as_me:17350: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13569: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17353: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13572: \$? = $ac_status" >&5
+ echo "$as_me:17356: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
@@ -13579,7 +17363,7 @@ eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:13582: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:17366: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<EOF
@@ -13591,20 +17375,21 @@ done
fi
-echo "$as_me:13594: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
-echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
+echo "$as_me:17378: checking definition to turn on extended curses functions" >&5
+echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
if test "${cf_cv_need_xopen_extension+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
+cf_cv_need_xopen_extension=unknown
cat >conftest.$ac_ext <<_ACEOF
-#line 13601 "configure"
+#line 17386 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
#if defined(NCURSES_VERSION_PATCH)
@@ -13612,6 +17397,10 @@ main ()
make an error
#endif
#endif
+#ifdef NCURSES_VERSION
+ cchar_t check;
+ int check2 = curs_set((int)sizeof(check));
+#endif
long x = winnstr(stdscr, "", 0);
int x1, y1;
getbegyx(stdscr, y1, x1)
@@ -13620,70 +17409,83 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13623: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17412: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13626: \$? = $ac_status" >&5
+ echo "$as_me:17415: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13629: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17418: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13632: \$? = $ac_status" >&5
+ echo "$as_me:17421: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_cv_need_xopen_extension=no
+ cf_cv_need_xopen_extension=none
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cat >conftest.$ac_ext <<_ACEOF
-#line 13639 "configure"
+
+ for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
+ do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 17431 "configure"
#include "confdefs.h"
-#define _XOPEN_SOURCE_EXTENDED
+#define $cf_try_xopen_extension 1
#include <stdlib.h>
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
#ifdef NCURSES_VERSION
- cchar_t check;
- int check2 = curs_set((int)sizeof(check));
+ cchar_t check;
+ int check2 = curs_set((int)sizeof(check));
#endif
- long x = winnstr(stdscr, "", 0);
- int x1, y1;
- getbegyx(stdscr, y1, x1)
+ long x = winnstr(stdscr, "", 0);
+ int x1, y1;
+ getbegyx(stdscr, y1, x1)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13661: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17453: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:13664: \$? = $ac_status" >&5
+ echo "$as_me:17456: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:13667: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17459: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13670: \$? = $ac_status" >&5
+ echo "$as_me:17462: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- cf_cv_need_xopen_extension=yes
+ cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
-cf_cv_need_xopen_extension=unknown
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
fi
-echo "$as_me:13682: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:17476: result: $cf_cv_need_xopen_extension" >&5
echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
-test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
-echo "$as_me:13686: checking for term.h" >&5
+case $cf_cv_need_xopen_extension in
+(*_*)
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
+
+ ;;
+esac
+
+echo "$as_me:17488: checking for term.h" >&5
echo $ECHO_N "checking for term.h... $ECHO_C" >&6
if test "${cf_cv_term_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13694,8 +17496,8 @@ else
cf_header_list="term.h ncurses/term.h ncursesw/term.h"
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
cf_header_list="$cf_header_item $cf_header_list"
;;
@@ -13704,13 +17506,13 @@ esac
for cf_header in $cf_header_list
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13707 "configure"
+#line 17509 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>
int
-main ()
+main (void)
{
WINDOW *x
;
@@ -13718,16 +17520,16 @@ WINDOW *x
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13721: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17523: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13724: \$? = $ac_status" >&5
+ echo "$as_me:17526: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13727: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17529: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13730: \$? = $ac_status" >&5
+ echo "$as_me:17532: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header=$cf_header
break
@@ -13739,14 +17541,14 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
done
-case $cf_cv_term_header in #(vi
-no)
+case $cf_cv_term_header in
+(no)
# If curses is ncurses, some packagers still mess it up by trying to make
# us use GNU termcap. This handles the most common case.
for cf_header in ncurses/term.h ncursesw/term.h
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13749 "configure"
+#line 17551 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -13756,7 +17558,7 @@ no)
make an error
#endif
int
-main ()
+main (void)
{
WINDOW *x
;
@@ -13764,16 +17566,16 @@ WINDOW *x
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13767: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17569: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13770: \$? = $ac_status" >&5
+ echo "$as_me:17572: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13773: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17575: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13776: \$? = $ac_status" >&5
+ echo "$as_me:17578: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_term_header=$cf_header
break
@@ -13788,25 +17590,25 @@ rm -f conftest.$ac_objext conftest.$ac_ext
esac
fi
-echo "$as_me:13791: result: $cf_cv_term_header" >&5
+echo "$as_me:17593: result: $cf_cv_term_header" >&5
echo "${ECHO_T}$cf_cv_term_header" >&6
-case $cf_cv_term_header in #(vi
-term.h) #(vi
+case $cf_cv_term_header in
+(term.h)
cat >>confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF
;;
-ncurses/term.h) #(vi
+(ncurses/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF
;;
-ncursesw/term.h)
+(ncursesw/term.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
@@ -13815,7 +17617,7 @@ EOF
;;
esac
-echo "$as_me:13818: checking for unctrl.h" >&5
+echo "$as_me:17620: checking for unctrl.h" >&5
echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
if test "${cf_cv_unctrl_header+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13826,8 +17628,8 @@ else
cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
cf_header_list="$cf_header_item $cf_header_list"
;;
@@ -13836,13 +17638,13 @@ esac
for cf_header in $cf_header_list
do
cat >conftest.$ac_ext <<_ACEOF
-#line 13839 "configure"
+#line 17641 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
#include <${cf_header}>
int
-main ()
+main (void)
{
WINDOW *x
;
@@ -13850,16 +17652,16 @@ WINDOW *x
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13853: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17655: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:13856: \$? = $ac_status" >&5
+ echo "$as_me:17658: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:13859: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17661: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:13862: \$? = $ac_status" >&5
+ echo "$as_me:17664: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_unctrl_header=$cf_header
break
@@ -13872,32 +17674,32 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:13875: result: $cf_cv_unctrl_header" >&5
+echo "$as_me:17677: result: $cf_cv_unctrl_header" >&5
echo "${ECHO_T}$cf_cv_unctrl_header" >&6
-case $cf_cv_unctrl_header in #(vi
-no)
- { echo "$as_me:13880: WARNING: unctrl.h header not found" >&5
+case $cf_cv_unctrl_header in
+(no)
+ { echo "$as_me:17682: WARNING: unctrl.h header not found" >&5
echo "$as_me: WARNING: unctrl.h header not found" >&2;}
;;
esac
-case $cf_cv_unctrl_header in #(vi
-unctrl.h) #(vi
+case $cf_cv_unctrl_header in
+(unctrl.h)
cat >>confdefs.h <<\EOF
#define HAVE_UNCTRL_H 1
EOF
;;
-ncurses/unctrl.h) #(vi
+(ncurses/unctrl.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSES_UNCTRL_H 1
EOF
;;
-ncursesw/unctrl.h)
+(ncursesw/unctrl.h)
cat >>confdefs.h <<\EOF
#define HAVE_NCURSESW_UNCTRL_H 1
@@ -13907,9 +17709,14 @@ EOF
esac
for cf_func in \
+alloc_pair \
assume_default_colors \
chgat \
+color_content \
color_set \
+copywin \
+delscreen \
+dupwin \
filter \
getbegx \
getcurx \
@@ -13917,12 +17724,19 @@ getmaxx \
getnstr \
getparx \
getwin \
+halfdelay \
+init_extended_color \
+mvderwin \
mvvline \
+mvwin \
mvwvline \
napms \
+newpad \
putwin \
+reset_color_pairs \
resize_term \
resizeterm \
+restartterm \
ripoffline \
scr_dump \
setupterm \
@@ -13932,6 +17746,7 @@ termattrs \
tgetent \
tigetnum \
tigetstr \
+tputs_sp \
typeahead \
use_default_colors \
use_env \
@@ -13943,18 +17758,20 @@ vidputs \
vsscanf \
vw_printw \
wchgat \
+winsdelln \
winsstr \
wresize \
wsyncdown \
+_tracef \
do
cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- echo "$as_me:13954: checking for ${cf_func}" >&5
+ echo "$as_me:17771: checking for ${cf_func}" >&5
echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
-echo "${as_me:-configure}:13957: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17774: testing ${cf_func} ..." 1>&5
if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13963,7 +17780,7 @@ else
eval cf_result='$ac_cv_func_'$cf_func
if test ".$cf_result" != ".no"; then
cat >conftest.$ac_ext <<_ACEOF
-#line 13966 "configure"
+#line 17783 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -13981,14 +17798,14 @@ char * XCursesProgramName = "test";
#endif
int
-main ()
+main (void)
{
#ifndef ${cf_func}
long foo = (long)(&${cf_func});
-fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
-if (foo + 1234 > 5678)
- ${cf_cv_main_return:-return}(foo);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
+if (foo + 1234L > 5678L)
+ ${cf_cv_main_return:-return}(foo != 0);
#endif
;
@@ -13996,16 +17813,16 @@ if (foo + 1234 > 5678)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13999: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17816: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14002: \$? = $ac_status" >&5
+ echo "$as_me:17819: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14005: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17822: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14008: \$? = $ac_status" >&5
+ echo "$as_me:17825: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14021,7 +17838,7 @@ fi
# use the computed/retrieved cache-value:
eval 'cf_result=$cf_cv_func_'$cf_func
- echo "$as_me:14024: result: $cf_result" >&5
+ echo "$as_me:17841: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result != no; then
cat >>confdefs.h <<EOF
@@ -14036,10 +17853,10 @@ do
cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
- echo "$as_me:14039: checking for ${cf_func}" >&5
+ echo "$as_me:17856: checking for ${cf_func}" >&5
echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
-echo "${as_me:-configure}:14042: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:17859: testing ${cf_func} ..." 1>&5
if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14048,7 +17865,7 @@ else
eval cf_result='$ac_cv_func_'$cf_func
if test ".$cf_result" != ".no"; then
cat >conftest.$ac_ext <<_ACEOF
-#line 14051 "configure"
+#line 17868 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -14066,14 +17883,14 @@ char * XCursesProgramName = "test";
#endif
int
-main ()
+main (void)
{
#ifndef ${cf_func}
long foo = (long)(&${cf_func});
-fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
-if (foo + 1234 > 5678)
- ${cf_cv_main_return:-return}(foo);
+fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
+if (foo + 1234L > 5678L)
+ ${cf_cv_main_return:-return}(foo != 0);
#endif
;
@@ -14081,16 +17898,16 @@ if (foo + 1234 > 5678)
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14084: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17901: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14087: \$? = $ac_status" >&5
+ echo "$as_me:17904: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14090: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17907: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14093: \$? = $ac_status" >&5
+ echo "$as_me:17910: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14106,7 +17923,7 @@ fi
# use the computed/retrieved cache-value:
eval 'cf_result=$cf_cv_func_'$cf_func
- echo "$as_me:14109: result: $cf_result" >&5
+ echo "$as_me:17926: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result != no; then
cat >>confdefs.h <<EOF
@@ -14130,7 +17947,7 @@ then
cf_return="return value"
fi
cat >conftest.$ac_ext <<_ACEOF
-#line 14133 "configure"
+#line 17950 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
@@ -14139,7 +17956,7 @@ then
static $cf_ret outc($cf_arg value) { $cf_return; }
int
-main ()
+main (void)
{
tputs("hello", 0, outc);
@@ -14150,21 +17967,21 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14153: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17970: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14156: \$? = $ac_status" >&5
+ echo "$as_me:17973: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14159: \"$ac_try\"") >&5
+ { (eval echo "$as_me:17976: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14162: \$? = $ac_status" >&5
+ echo "$as_me:17979: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
test -n "$verbose" && echo " prototype $cf_ret func($cf_arg value)" 1>&6
-echo "${as_me:-configure}:14167: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
+echo "${as_me:-configure}:17984: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
cat >>confdefs.h <<EOF
#define TPUTS_ARG $cf_arg
@@ -14184,19 +18001,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-echo "$as_me:14187: checking for ncurses extended functions" >&5
+echo "$as_me:18004: checking for ncurses extended functions" >&5
echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14194 "configure"
+#line 18011 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
int x = NCURSES_EXT_FUNCS
@@ -14206,16 +18023,16 @@ int x = NCURSES_EXT_FUNCS
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18026: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14212: \$? = $ac_status" >&5
+ echo "$as_me:18029: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14215: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18032: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14218: \$? = $ac_status" >&5
+ echo "$as_me:18035: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_ext_funcs=defined
else
@@ -14223,12 +18040,12 @@ else
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14226 "configure"
+#line 18043 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
(void) assume_default_colors (0, 0);
@@ -14248,16 +18065,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14251: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18068: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14254: \$? = $ac_status" >&5
+ echo "$as_me:18071: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14257: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18074: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14260: \$? = $ac_status" >&5
+ echo "$as_me:18077: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_ncurses_ext_funcs=yes
else
@@ -14271,7 +18088,7 @@ fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14274: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "$as_me:18091: result: $cf_cv_ncurses_ext_funcs" >&5
echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
test "$cf_cv_ncurses_ext_funcs" = yes &&
cat >>confdefs.h <<\EOF
@@ -14285,16 +18102,16 @@ then
if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
then
cf_define_xpg5=no
- echo "$as_me:14288: checking if _XPG5 should be defined to enable wide-characters" >&5
+ echo "$as_me:18105: checking if _XPG5 should be defined to enable wide-characters" >&5
echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14292 "configure"
+#line 18109 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
int x = _XPG5
;
@@ -14302,16 +18119,16 @@ int x = _XPG5
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14305: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18122: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14308: \$? = $ac_status" >&5
+ echo "$as_me:18125: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14311: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18128: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14314: \$? = $ac_status" >&5
+ echo "$as_me:18131: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
:
else
@@ -14320,12 +18137,12 @@ cat conftest.$ac_ext >&5
cf_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_XPG5"
cat >conftest.$ac_ext <<_ACEOF
-#line 14323 "configure"
+#line 18140 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
int x = _XPG5
;
@@ -14333,16 +18150,16 @@ int x = _XPG5
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14336: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18153: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14339: \$? = $ac_status" >&5
+ echo "$as_me:18156: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14342: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18159: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14345: \$? = $ac_status" >&5
+ echo "$as_me:18162: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_define_xpg5=yes
else
@@ -14353,7 +18170,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
CPPFLAGS="$cf_save_cppflags"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- echo "$as_me:14356: result: $cf_define_xpg5" >&5
+ echo "$as_me:18173: result: $cf_define_xpg5" >&5
echo "${ECHO_T}$cf_define_xpg5" >&6
if test "$cf_define_xpg5" = yes
@@ -14362,19 +18179,19 @@ echo "${ECHO_T}$cf_define_xpg5" >&6
fi
fi
- echo "$as_me:14365: checking for wide-character functions" >&5
+ echo "$as_me:18182: checking for wide-character functions" >&5
echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
if test "${cf_cv_widechar_funcs+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14372 "configure"
+#line 18189 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
static wchar_t src_wchar[2];
@@ -14386,16 +18203,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14389: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18206: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14392: \$? = $ac_status" >&5
+ echo "$as_me:18209: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14395: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18212: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14398: \$? = $ac_status" >&5
+ echo "$as_me:18215: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_widechar_funcs=yes
else
@@ -14406,7 +18223,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:14409: result: $cf_cv_widechar_funcs" >&5
+echo "$as_me:18226: result: $cf_cv_widechar_funcs" >&5
echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
if test "$cf_cv_widechar_funcs" != no ; then
@@ -14427,14 +18244,66 @@ EOF
fi
-echo "$as_me:14430: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:18247: checking if $cf_cv_screen library uses pthreads" >&5
+echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
+if test "${cf_cv_use_pthreads+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 18254 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+extern void _nc_init_pthreads(void);
+
+int
+main (void)
+{
+
+ initscr();
+ _nc_init_pthreads();
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:18272: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:18275: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:18278: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:18281: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_use_pthreads=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_use_pthreads=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:18292: result: $cf_cv_use_pthreads" >&5
+echo "${ECHO_T}$cf_cv_use_pthreads" >&6
+test $cf_cv_use_pthreads = yes &&
+cat >>confdefs.h <<\EOF
+#define USE_PTHREADS 1
+EOF
+
+echo "$as_me:18299: checking if sys/time.h works with sys/select.h" >&5
echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
if test "${cf_cv_sys_time_select+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14437 "configure"
+#line 18306 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -14446,7 +18315,7 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
int
-main ()
+main (void)
{
;
@@ -14454,16 +18323,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14457: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18326: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14460: \$? = $ac_status" >&5
+ echo "$as_me:18329: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14463: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18332: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14466: \$? = $ac_status" >&5
+ echo "$as_me:18335: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_sys_time_select=yes
else
@@ -14475,14 +18344,176 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14478: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:18347: result: $cf_cv_sys_time_select" >&5
echo "${ECHO_T}$cf_cv_sys_time_select" >&6
test "$cf_cv_sys_time_select" = yes &&
cat >>confdefs.h <<\EOF
#define HAVE_SYS_TIME_SELECT 1
EOF
-echo "$as_me:14485: checking for function curses_version" >&5
+# special check for test/ditto.c
+
+echo "$as_me:18356: checking for openpty in -lutil" >&5
+echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
+if test "${ac_cv_lib_util_openpty+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 18364 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char openpty ();
+int
+main (void)
+{
+openpty ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:18383: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:18386: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:18389: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:18392: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_util_openpty=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_util_openpty=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:18403: result: $ac_cv_lib_util_openpty" >&5
+echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
+if test $ac_cv_lib_util_openpty = yes; then
+ cf_cv_lib_util=yes
+else
+ cf_cv_lib_util=no
+fi
+
+echo "$as_me:18411: checking for openpty header" >&5
+echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
+if test "${cf_cv_func_openpty+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_save_LIBS="$LIBS"
+ test $cf_cv_lib_util = yes && {
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+LIBS="$cf_add_libs"
+ }
+ for cf_header in pty.h libutil.h util.h
+ do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 18438 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+
+int
+main (void)
+{
+
+ int x = openpty((int *)0, (int *)0, (char *)0,
+ (struct termios *)0, (struct winsize *)0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:18455: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:18458: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:18461: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:18464: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_func_openpty=$cf_header
+ break
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_func_openpty=no
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+ LIBS="$cf_save_LIBS"
+
+fi
+echo "$as_me:18482: result: $cf_cv_func_openpty" >&5
+echo "${ECHO_T}$cf_cv_func_openpty" >&6
+
+if test "$cf_cv_func_openpty" != no ; then
+
+cat >>confdefs.h <<EOF
+#define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
+EOF
+
+cat >>confdefs.h <<\EOF
+#define USE_XTERM_PTY 1
+EOF
+
+ if test "x$cf_cv_lib_util" = xyes ; then
+
+cf_add_libs="$TEST_LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
+ cf_add_1lib=
+ break
+ fi
+ done
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
+done
+TEST_LIBS="$cf_add_libs"
+
+ fi
+fi
+
+echo "$as_me:18516: checking for function curses_version" >&5
echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
if test "${cf_cv_func_curses_version+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14492,11 +18523,11 @@ if test "$cross_compiling" = yes; then
cf_cv_func_curses_version=unknown
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14495 "configure"
+#line 18526 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
-int main()
+int main(void)
{
char temp[1024];
sprintf(temp, "%s\n", curses_version());
@@ -14505,15 +18536,15 @@ int main()
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14508: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18539: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14511: \$? = $ac_status" >&5
+ echo "$as_me:18542: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:14513: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18544: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14516: \$? = $ac_status" >&5
+ echo "$as_me:18547: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_func_curses_version=yes
@@ -14528,14 +18559,14 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
rm -f core
fi
-echo "$as_me:14531: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:18562: result: $cf_cv_func_curses_version" >&5
echo "${ECHO_T}$cf_cv_func_curses_version" >&6
test "$cf_cv_func_curses_version" = yes &&
cat >>confdefs.h <<\EOF
#define HAVE_CURSES_VERSION 1
EOF
-echo "$as_me:14538: checking for alternate character set array" >&5
+echo "$as_me:18569: checking for alternate character set array" >&5
echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
if test "${cf_cv_curses_acs_map+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14545,13 +18576,13 @@ cf_cv_curses_acs_map=unknown
for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
do
cat >conftest.$ac_ext <<_ACEOF
-#line 14548 "configure"
+#line 18579 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
$name['k'] = ACS_PLUS
@@ -14561,16 +18592,16 @@ $name['k'] = ACS_PLUS
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14564: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18595: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14567: \$? = $ac_status" >&5
+ echo "$as_me:18598: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14570: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18601: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14573: \$? = $ac_status" >&5
+ echo "$as_me:18604: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_acs_map=$name; break
else
@@ -14581,7 +18612,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
done
fi
-echo "$as_me:14584: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:18615: result: $cf_cv_curses_acs_map" >&5
echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
test "$cf_cv_curses_acs_map" != unknown &&
@@ -14591,7 +18622,7 @@ EOF
if test "$cf_enable_widec" = yes; then
-echo "$as_me:14594: checking for wide alternate character set array" >&5
+echo "$as_me:18625: checking for wide alternate character set array" >&5
echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
if test "${cf_cv_curses_wacs_map+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14601,7 +18632,7 @@ else
for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
do
cat >conftest.$ac_ext <<_ACEOF
-#line 14604 "configure"
+#line 18635 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14609,7 +18640,7 @@ else
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
void *foo = &($name['k'])
;
@@ -14617,16 +18648,16 @@ void *foo = &($name['k'])
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14620: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18651: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14623: \$? = $ac_status" >&5
+ echo "$as_me:18654: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14626: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18657: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14629: \$? = $ac_status" >&5
+ echo "$as_me:18660: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_map=$name
break
@@ -14637,7 +18668,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
done
fi
-echo "$as_me:14640: result: $cf_cv_curses_wacs_map" >&5
+echo "$as_me:18671: result: $cf_cv_curses_wacs_map" >&5
echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
test "$cf_cv_curses_wacs_map" != unknown &&
@@ -14645,7 +18676,7 @@ cat >>confdefs.h <<EOF
#define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
EOF
-echo "$as_me:14648: checking for wide alternate character constants" >&5
+echo "$as_me:18679: checking for wide alternate character constants" >&5
echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
if test "${cf_cv_curses_wacs_symbols+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14655,7 +18686,7 @@ cf_cv_curses_wacs_symbols=no
if test "$cf_cv_curses_wacs_map" != unknown
then
cat >conftest.$ac_ext <<_ACEOF
-#line 14658 "configure"
+#line 18689 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14663,7 +18694,7 @@ then
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
cchar_t *foo = WACS_PLUS;
$cf_cv_curses_wacs_map['k'] = *WACS_PLUS
@@ -14672,16 +18703,16 @@ cchar_t *foo = WACS_PLUS;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14675: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18706: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14678: \$? = $ac_status" >&5
+ echo "$as_me:18709: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14681: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18712: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14684: \$? = $ac_status" >&5
+ echo "$as_me:18715: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_symbols=yes
else
@@ -14691,7 +18722,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14694 "configure"
+#line 18725 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14699,7 +18730,7 @@ else
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
cchar_t *foo = WACS_PLUS
;
@@ -14707,16 +18738,16 @@ cchar_t *foo = WACS_PLUS
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14710: \"$ac_link\"") >&5
+if { (eval echo "$as_me:18741: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:14713: \$? = $ac_status" >&5
+ echo "$as_me:18744: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:14716: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18747: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14719: \$? = $ac_status" >&5
+ echo "$as_me:18750: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_curses_wacs_symbols=yes
else
@@ -14727,7 +18758,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
fi
-echo "$as_me:14730: result: $cf_cv_curses_wacs_symbols" >&5
+echo "$as_me:18761: result: $cf_cv_curses_wacs_symbols" >&5
echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
test "$cf_cv_curses_wacs_symbols" != no &&
@@ -14737,10 +18768,10 @@ EOF
fi
-echo "$as_me:14740: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:18771: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 14743 "configure"
+#line 18774 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -14748,7 +18779,7 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
attr_t foo
@@ -14758,16 +18789,16 @@ attr_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14761: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18792: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14764: \$? = $ac_status" >&5
+ echo "$as_me:18795: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14767: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18798: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14770: \$? = $ac_status" >&5
+ echo "$as_me:18801: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -14776,7 +18807,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14779: result: $cf_result" >&5
+echo "$as_me:18810: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -14797,14 +18828,14 @@ fi
if test "$cf_enable_widec" = yes; then
# This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:14800: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:18831: checking if we must include wchar.h to declare mbstate_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
if test "${cf_cv_mbstate_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14807 "configure"
+#line 18838 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14814,7 +18845,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
mbstate_t state
;
@@ -14822,23 +18853,23 @@ mbstate_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14825: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18856: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14828: \$? = $ac_status" >&5
+ echo "$as_me:18859: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14831: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18862: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14834: \$? = $ac_status" >&5
+ echo "$as_me:18865: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_mbstate_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14841 "configure"
+#line 18872 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14849,7 +18880,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
mbstate_t value
;
@@ -14857,16 +18888,16 @@ mbstate_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14860: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18891: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14863: \$? = $ac_status" >&5
+ echo "$as_me:18894: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14866: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18897: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14869: \$? = $ac_status" >&5
+ echo "$as_me:18900: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_mbstate_t=yes
else
@@ -14878,7 +18909,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14881: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:18912: result: $cf_cv_mbstate_t" >&5
echo "${ECHO_T}$cf_cv_mbstate_t" >&6
if test "$cf_cv_mbstate_t" = yes ; then
@@ -14901,14 +18932,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
fi
# This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:14904: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:18935: checking if we must include wchar.h to declare wchar_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
if test "${cf_cv_wchar_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 14911 "configure"
+#line 18942 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14918,7 +18949,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
wchar_t state
;
@@ -14926,23 +18957,23 @@ wchar_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18960: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14932: \$? = $ac_status" >&5
+ echo "$as_me:18963: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14935: \"$ac_try\"") >&5
+ { (eval echo "$as_me:18966: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14938: \$? = $ac_status" >&5
+ echo "$as_me:18969: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wchar_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 14945 "configure"
+#line 18976 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -14953,7 +18984,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
wchar_t value
;
@@ -14961,16 +18992,16 @@ wchar_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14964: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:18995: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:14967: \$? = $ac_status" >&5
+ echo "$as_me:18998: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:14970: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19001: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:14973: \$? = $ac_status" >&5
+ echo "$as_me:19004: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wchar_t=yes
else
@@ -14982,7 +19013,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:14985: result: $cf_cv_wchar_t" >&5
+echo "$as_me:19016: result: $cf_cv_wchar_t" >&5
echo "${ECHO_T}$cf_cv_wchar_t" >&6
if test "$cf_cv_wchar_t" = yes ; then
@@ -15005,14 +19036,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
fi
# This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:15008: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:19039: checking if we must include wchar.h to declare wint_t" >&5
echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
if test "${cf_cv_wint_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 15015 "configure"
+#line 19046 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -15022,7 +19053,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
wint_t state
;
@@ -15030,23 +19061,23 @@ wint_t state
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15033: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19064: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15036: \$? = $ac_status" >&5
+ echo "$as_me:19067: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15039: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19070: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15042: \$? = $ac_status" >&5
+ echo "$as_me:19073: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wint_t=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
-#line 15049 "configure"
+#line 19080 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -15057,7 +19088,7 @@ cat >conftest.$ac_ext <<_ACEOF
#include <libutf8.h>
#endif
int
-main ()
+main (void)
{
wint_t value
;
@@ -15065,16 +19096,16 @@ wint_t value
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15068: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19099: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15071: \$? = $ac_status" >&5
+ echo "$as_me:19102: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15074: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19105: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15077: \$? = $ac_status" >&5
+ echo "$as_me:19108: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_cv_wint_t=yes
else
@@ -15086,7 +19117,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:15089: result: $cf_cv_wint_t" >&5
+echo "$as_me:19120: result: $cf_cv_wint_t" >&5
echo "${ECHO_T}$cf_cv_wint_t" >&6
if test "$cf_cv_wint_t" = yes ; then
@@ -15110,10 +19141,10 @@ fi
if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
-echo "$as_me:15113: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19144: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 15116 "configure"
+#line 19147 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -15121,7 +19152,7 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
mbstate_t foo
@@ -15131,16 +19162,16 @@ mbstate_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15134: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19165: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15137: \$? = $ac_status" >&5
+ echo "$as_me:19168: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15140: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19171: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15143: \$? = $ac_status" >&5
+ echo "$as_me:19174: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15149,7 +19180,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:15152: result: $cf_result" >&5
+echo "$as_me:19183: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -15171,10 +19202,10 @@ fi
if test "$NCURSES_OK_WCHAR_T" = 0 ; then
-echo "$as_me:15174: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19205: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 15177 "configure"
+#line 19208 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -15182,7 +19213,7 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
wchar_t foo
@@ -15192,16 +19223,16 @@ wchar_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15195: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19226: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15198: \$? = $ac_status" >&5
+ echo "$as_me:19229: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15201: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19232: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15204: \$? = $ac_status" >&5
+ echo "$as_me:19235: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15210,7 +19241,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:15213: result: $cf_result" >&5
+echo "$as_me:19244: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -15232,10 +19263,10 @@ fi
if test "$NCURSES_OK_WINT_T" = 0 ; then
-echo "$as_me:15235: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:19266: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 15238 "configure"
+#line 19269 "configure"
#include "confdefs.h"
#ifndef _XOPEN_SOURCE_EXTENDED
@@ -15243,7 +19274,7 @@ cat >conftest.$ac_ext <<_ACEOF
#endif
#include <${cf_cv_ncurses_header:-curses.h}>
int
-main ()
+main (void)
{
wint_t foo
@@ -15253,16 +19284,16 @@ wint_t foo
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15256: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19287: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15259: \$? = $ac_status" >&5
+ echo "$as_me:19290: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15262: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19293: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15265: \$? = $ac_status" >&5
+ echo "$as_me:19296: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15271,7 +19302,7 @@ cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:15274: result: $cf_result" >&5
+echo "$as_me:19305: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
@@ -15292,11 +19323,19 @@ fi
fi
fi
-echo "$as_me:15295: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+for cf_data in \
+TABSIZE \
+curscr \
+ospeed \
+boolnames \
+boolfnames \
+ttytype
+do
+echo "$as_me:19334: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
-#line 15299 "configure"
+#line 19338 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -15314,54 +19353,60 @@ char * XCursesProgramName = "test";
#endif
int
-main ()
+main (void)
{
-void *foo = &(boolnames)
+#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
+ const void *foo = (const void *)($cf_data);
+#else
+ const void *foo = &($cf_data);
+#endif
+ fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15327: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19371: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15330: \$? = $ac_status" >&5
+ echo "$as_me:19374: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15333: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19377: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15336: \$? = $ac_status" >&5
+ echo "$as_me:19380: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
+
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cf_result=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:15345: result: $cf_result" >&5
+echo "$as_me:19390: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
-cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
else
- echo "$as_me:15357: checking for data boolnames in library" >&5
-echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
+ echo "$as_me:19402: checking for data $cf_data in library" >&5
+echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
# BSD linkers insist on making weak linkage, but resolve at runtime.
if test "$cross_compiling" = yes; then
# cross-compiling
cat >conftest.$ac_ext <<_ACEOF
-#line 15364 "configure"
+#line 19409 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -15378,195 +19423,20 @@ char * XCursesProgramName = "test";
#endif
#endif
-extern char boolnames;
+extern char $cf_data;
int
-main ()
+main (void)
{
do {
- void *foo = &(boolnames);
- fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
- ${cf_cv_main_return:-return}(foo == 0);
- } while (0)
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15397: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:15400: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:15403: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:15406: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_result=yes
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line 15418 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
+#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
+ const void *foo = (const void *)($cf_data);
#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
+ const void *foo = &($cf_data);
#endif
-#endif
-
-extern char boolnames;
-int main(void)
-{
- void *foo = &(boolnames);
- fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
- ${cf_cv_main_return:-return}(foo == 0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15444: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:15447: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:15449: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:15452: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_result=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
- echo "$as_me:15463: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
- if test $cf_result = yes ; then
-
-cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+ fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
- cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
- fi
-fi
-
-echo "$as_me:15476: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
-echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 15480 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-int
-main ()
-{
-
-void *foo = &(boolfnames)
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15508: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:15511: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15514: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:15517: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cf_result=yes
-else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_result=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:15526: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
- cat >>confdefs.h <<EOF
-#define $cf_result 1
-EOF
-
-else
- echo "$as_me:15538: checking for data boolfnames in library" >&5
-echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
- # BSD linkers insist on making weak linkage, but resolve at runtime.
- if test "$cross_compiling" = yes; then
-
- # cross-compiling
- cat >conftest.$ac_ext <<_ACEOF
-#line 15545 "configure"
-#include "confdefs.h"
-
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header:-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#elif defined(HAVE_TERM_H)
-#include <term.h>
-#endif
-#endif
-
-extern char boolfnames;
-int
-main ()
-{
-
- do {
- void *foo = &(boolfnames);
- fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
${cf_cv_main_return:-return}(foo == 0);
} while (0)
@@ -15575,16 +19445,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:15578: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19448: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:15581: \$? = $ac_status" >&5
+ echo "$as_me:19451: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:15584: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19454: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15587: \$? = $ac_status" >&5
+ echo "$as_me:19457: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
else
@@ -15596,7 +19466,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
-#line 15599 "configure"
+#line 19469 "configure"
#include "confdefs.h"
#ifdef HAVE_XCURSES
@@ -15613,26 +19483,33 @@ char * XCursesProgramName = "test";
#endif
#endif
-extern char boolfnames;
+extern char $cf_data;
int main(void)
{
- void *foo = &(boolfnames);
- fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
+
+#if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
+ const void *foo = (const void *)($cf_data);
+#else
+ const void *foo = &($cf_data);
+#endif
+ fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
+
${cf_cv_main_return:-return}(foo == 0);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15625: \"$ac_link\"") >&5
+if { (eval echo "$as_me:19501: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:15628: \$? = $ac_status" >&5
+ echo "$as_me:19504: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:15630: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19506: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15633: \$? = $ac_status" >&5
+ echo "$as_me:19509: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_result=yes
+
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
@@ -15641,39 +19518,41 @@ cf_result=no
fi
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
- echo "$as_me:15644: result: $cf_result" >&5
+ echo "$as_me:19521: result: $cf_result" >&5
echo "${ECHO_T}$cf_result" >&6
if test $cf_result = yes ; then
-cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
cat >>confdefs.h <<EOF
#define $cf_result 1
EOF
+ # do not exit loop here, since we prefer system's declarations
fi
fi
+done
if ( test "$GCC" = yes || test "$GXX" = yes )
then
-echo "$as_me:15659: checking if you want to turn on gcc warnings" >&5
+echo "$as_me:19538: checking if you want to turn on gcc warnings" >&5
echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
# Check whether --enable-warnings or --disable-warnings was given.
if test "${enable_warnings+set}" = set; then
enableval="$enable_warnings"
test "$enableval" != yes && enableval=no
- if test "$enableval" != "no" ; then
+ if test "$enableval" != "no" ; then
with_warnings=yes
- else
- with_warnings=no
- fi
+ else
+ with_warnings=no
+ fi
else
enableval=no
- with_warnings=no
+ with_warnings=no
fi;
-echo "$as_me:15676: result: $with_warnings" >&5
+echo "$as_me:19555: result: $with_warnings" >&5
echo "${ECHO_T}$with_warnings" >&6
if test "$with_warnings" = "yes"
then
@@ -15696,10 +19575,10 @@ cat > conftest.i <<EOF
EOF
if test "$GCC" = yes
then
- { echo "$as_me:15699: checking for $CC __attribute__ directives..." >&5
+ { echo "$as_me:19578: checking for $CC __attribute__ directives..." >&5
echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
cat > conftest.$ac_ext <<EOF
-#line 15702 "${as_me:-configure}"
+#line 19581 "${as_me:-configure}"
#include "confdefs.h"
#include "conftest.h"
#include "conftest.i"
@@ -15728,43 +19607,43 @@ cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFG
cf_directive="__attribute__(($cf_attribute))"
echo "checking for $CC $cf_directive" 1>&5
- case $cf_attribute in #(vi
- printf) #(vi
+ case $cf_attribute in
+ (printf)
cf_printf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- scanf) #(vi
+ (scanf)
cf_scanf_attribute=yes
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE 1
EOF
;;
- *) #(vi
+ (*)
cat >conftest.h <<EOF
#define GCC_$cf_ATTRIBUTE $cf_directive
EOF
;;
esac
- if { (eval echo "$as_me:15751: \"$ac_compile\"") >&5
+ if { (eval echo "$as_me:19630: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15754: \$? = $ac_status" >&5
+ echo "$as_me:19633: \$? = $ac_status" >&5
(exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:15756: result: ... $cf_attribute" >&5
+ test -n "$verbose" && echo "$as_me:19635: result: ... $cf_attribute" >&5
echo "${ECHO_T}... $cf_attribute" >&6
cat conftest.h >>confdefs.h
- case $cf_attribute in #(vi
- noreturn) #(vi
+ case $cf_attribute in
+ (noreturn)
cat >>confdefs.h <<EOF
#define GCC_NORETURN $cf_directive
EOF
;;
- printf) #(vi
+ (printf)
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
@@ -15780,7 +19659,7 @@ cat >>confdefs.h <<EOF
EOF
;;
- scanf) #(vi
+ (scanf)
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
@@ -15796,7 +19675,7 @@ cat >>confdefs.h <<EOF
EOF
;;
- unused) #(vi
+ (unused)
cat >>confdefs.h <<EOF
#define GCC_UNUSED $cf_directive
@@ -15812,113 +19691,132 @@ fi
rm -rf conftest*
fi
-INTEL_COMPILER=no
+if test "x$have_x" = xyes; then
-if test "$GCC" = yes ; then
- case $host_os in
- linux*|gnu*)
- echo "$as_me:15820: checking if this is really Intel C compiler" >&5
-echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
- cf_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -no-gcc"
- cat >conftest.$ac_ext <<_ACEOF
-#line 15825 "configure"
+cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
+cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
+cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
+LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
+for cf_X_CFLAGS in $X_CFLAGS
+do
+ case "x$cf_X_CFLAGS" in
+ x-[IUD]*)
+ CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS $cf_X_CFLAGS"
+ ;;
+ esac
+done
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 19713 "configure"
#include "confdefs.h"
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+
int
-main ()
+main (void)
{
-
-#ifdef __INTEL_COMPILER
-#else
-make an error
-#endif
-
+String foo = malloc(1)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15842: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19728: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15845: \$? = $ac_status" >&5
+ echo "$as_me:19731: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15848: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19734: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15851: \$? = $ac_status" >&5
+ echo "$as_me:19737: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147"
+echo "$as_me:19740: checking for X11/Xt const-feature" >&5
+echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
+if test "${cf_cv_const_x_string+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$cf_save_CFLAGS"
- echo "$as_me:15862: result: $INTEL_COMPILER" >&5
-echo "${ECHO_T}$INTEL_COMPILER" >&6
- ;;
- esac
-fi
-CLANG_COMPILER=no
-
-if test "$GCC" = yes ; then
- echo "$as_me:15871: checking if this is really Clang C compiler" >&5
-echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
- cf_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Qunused-arguments"
cat >conftest.$ac_ext <<_ACEOF
-#line 15876 "configure"
+#line 19747 "configure"
#include "confdefs.h"
+#define _CONST_X_STRING /* X11R7.8 (perhaps) */
+#undef XTSTRINGDEFINES /* X11R5 and later */
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+
int
-main ()
+main (void)
{
-
-#ifdef __clang__
-#else
-make an error
-#endif
-
+String foo = malloc(1); *foo = 0
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15893: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:19764: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15896: \$? = $ac_status" >&5
+ echo "$as_me:19767: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:15899: \"$ac_try\"") >&5
+ { (eval echo "$as_me:19770: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:15902: \$? = $ac_status" >&5
+ echo "$as_me:19773: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- CLANG_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+
+ cf_cv_const_x_string=no
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
+
+ cf_cv_const_x_string=yes
+
fi
rm -f conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$cf_save_CFLAGS"
- echo "$as_me:15913: result: $CLANG_COMPILER" >&5
-echo "${ECHO_T}$CLANG_COMPILER" >&6
+
fi
+echo "$as_me:19788: result: $cf_cv_const_x_string" >&5
+echo "${ECHO_T}$cf_cv_const_x_string" >&6
+
+LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
+CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
+CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
+
+case $cf_cv_const_x_string in
+(no)
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
+ ;;
+(*)
+
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
+
+ ;;
+esac
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
cat > conftest.$ac_ext <<EOF
-#line 15918 "${as_me:-configure}"
+#line 19817 "${as_me:-configure}"
int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
EOF
-
if test "$INTEL_COMPILER" = yes
then
# The "-wdXXX" options suppress warnings:
@@ -15932,7 +19830,7 @@ then
# remark #981: operands are evaluated in unspecified order
# warning #279: controlling expression is constant
- { echo "$as_me:15935: checking for $CC warning options..." >&5
+ { echo "$as_me:19833: checking for $CC warning options..." >&5
echo "$as_me: checking for $CC warning options..." >&6;}
cf_save_CFLAGS="$CFLAGS"
EXTRA_CFLAGS="-Wall"
@@ -15948,21 +19846,20 @@ echo "$as_me: checking for $CC warning options..." >&6;}
wd981
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
- if { (eval echo "$as_me:15951: \"$ac_compile\"") >&5
+ if { (eval echo "$as_me:19849: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15954: \$? = $ac_status" >&5
+ echo "$as_me:19852: \$? = $ac_status" >&5
(exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:15956: result: ... -$cf_opt" >&5
+ test -n "$verbose" && echo "$as_me:19854: result: ... -$cf_opt" >&5
echo "${ECHO_T}... -$cf_opt" >&6
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
done
CFLAGS="$cf_save_CFLAGS"
-
-elif test "$GCC" = yes
+elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
then
- { echo "$as_me:15965: checking for $CC warning options..." >&5
+ { echo "$as_me:19862: checking for $CC warning options..." >&5
echo "$as_me: checking for $CC warning options..." >&6;}
cf_save_CFLAGS="$CFLAGS"
EXTRA_CFLAGS=
@@ -15983,36 +19880,33 @@ echo "$as_me: checking for $CC warning options..." >&6;}
Wpointer-arith \
Wshadow \
Wstrict-prototypes \
- Wundef $cf_gcc_warnings $cf_warn_CONST
+ Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
do
CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
- if { (eval echo "$as_me:15989: \"$ac_compile\"") >&5
+ if { (eval echo "$as_me:19886: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
- echo "$as_me:15992: \$? = $ac_status" >&5
+ echo "$as_me:19889: \$? = $ac_status" >&5
(exit $ac_status); }; then
- test -n "$verbose" && echo "$as_me:15994: result: ... -$cf_opt" >&5
+ test -n "$verbose" && echo "$as_me:19891: result: ... -$cf_opt" >&5
echo "${ECHO_T}... -$cf_opt" >&6
- case $cf_opt in #(vi
- Wcast-qual) #(vi
- CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
- ;;
- Winline) #(vi
+ case $cf_opt in
+ (Winline)
case $GCC_VERSION in
- [34].*)
+ ([34].*)
test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
-echo "${as_me:-configure}:16005: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19899: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
continue;;
esac
;;
- Wpointer-arith) #(vi
+ (Wpointer-arith)
case $GCC_VERSION in
- [12].*)
+ ([12].*)
test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
-echo "${as_me:-configure}:16015: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:19909: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
continue;;
esac
@@ -16028,7 +19922,7 @@ rm -rf conftest*
fi
fi
-echo "$as_me:16031: checking if you want to use dmalloc for testing" >&5
+echo "$as_me:19925: checking if you want to use dmalloc for testing" >&5
echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
# Check whether --with-dmalloc or --without-dmalloc was given.
@@ -16045,15 +19939,15 @@ EOF
else
with_dmalloc=
fi;
-echo "$as_me:16048: result: ${with_dmalloc:-no}" >&5
+echo "$as_me:19942: result: ${with_dmalloc:-no}" >&5
echo "${ECHO_T}${with_dmalloc:-no}" >&6
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
+case .$with_cflags in
+(.*-g*)
+ case .$CFLAGS in
+ (.*-g*)
;;
- *)
+ (*)
cf_fix_cppflags=no
cf_new_cflags=
@@ -16063,11 +19957,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in -g
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -16075,20 +19969,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -16097,17 +19997,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -16120,17 +20028,23 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
;;
@@ -16139,23 +20053,23 @@ fi
esac
if test "$with_dmalloc" = yes ; then
- echo "$as_me:16142: checking for dmalloc.h" >&5
+ echo "$as_me:20056: checking for dmalloc.h" >&5
echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
if test "${ac_cv_header_dmalloc_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 16148 "configure"
+#line 20062 "configure"
#include "confdefs.h"
#include <dmalloc.h>
_ACEOF
-if { (eval echo "$as_me:16152: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:20066: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:16158: \$? = $ac_status" >&5
+ echo "$as_me:20072: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16174,11 +20088,11 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:16177: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:20091: result: $ac_cv_header_dmalloc_h" >&5
echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
if test $ac_cv_header_dmalloc_h = yes; then
-echo "$as_me:16181: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:20095: checking for dmalloc_debug in -ldmalloc" >&5
echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16186,7 +20100,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldmalloc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 16189 "configure"
+#line 20103 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -16197,7 +20111,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char dmalloc_debug ();
int
-main ()
+main (void)
{
dmalloc_debug ();
;
@@ -16205,16 +20119,16 @@ dmalloc_debug ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16208: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20122: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:16211: \$? = $ac_status" >&5
+ echo "$as_me:20125: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:16214: \"$ac_try\"") >&5
+ { (eval echo "$as_me:20128: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:16217: \$? = $ac_status" >&5
+ echo "$as_me:20131: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dmalloc_dmalloc_debug=yes
else
@@ -16225,7 +20139,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:16228: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:20142: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
cat >>confdefs.h <<EOF
@@ -16240,7 +20154,7 @@ fi
fi
-echo "$as_me:16243: checking if you want to use dbmalloc for testing" >&5
+echo "$as_me:20157: checking if you want to use dbmalloc for testing" >&5
echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
# Check whether --with-dbmalloc or --without-dbmalloc was given.
@@ -16257,15 +20171,15 @@ EOF
else
with_dbmalloc=
fi;
-echo "$as_me:16260: result: ${with_dbmalloc:-no}" >&5
+echo "$as_me:20174: result: ${with_dbmalloc:-no}" >&5
echo "${ECHO_T}${with_dbmalloc:-no}" >&6
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
+case .$with_cflags in
+(.*-g*)
+ case .$CFLAGS in
+ (.*-g*)
;;
- *)
+ (*)
cf_fix_cppflags=no
cf_new_cflags=
@@ -16275,11 +20189,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in -g
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -16287,20 +20201,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -16309,17 +20229,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -16332,17 +20260,23 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
;;
@@ -16351,23 +20285,23 @@ fi
esac
if test "$with_dbmalloc" = yes ; then
- echo "$as_me:16354: checking for dbmalloc.h" >&5
+ echo "$as_me:20288: checking for dbmalloc.h" >&5
echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
if test "${ac_cv_header_dbmalloc_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line 16360 "configure"
+#line 20294 "configure"
#include "confdefs.h"
#include <dbmalloc.h>
_ACEOF
-if { (eval echo "$as_me:16364: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:20298: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
- echo "$as_me:16370: \$? = $ac_status" >&5
+ echo "$as_me:20304: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
@@ -16386,11 +20320,11 @@ else
fi
rm -f conftest.err conftest.$ac_ext
fi
-echo "$as_me:16389: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:20323: result: $ac_cv_header_dbmalloc_h" >&5
echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
if test $ac_cv_header_dbmalloc_h = yes; then
-echo "$as_me:16393: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:20327: checking for debug_malloc in -ldbmalloc" >&5
echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16398,7 +20332,7 @@ else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldbmalloc $LIBS"
cat >conftest.$ac_ext <<_ACEOF
-#line 16401 "configure"
+#line 20335 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
@@ -16409,7 +20343,7 @@ extern "C"
builtin and then its argument prototype would still apply. */
char debug_malloc ();
int
-main ()
+main (void)
{
debug_malloc ();
;
@@ -16417,16 +20351,16 @@ debug_malloc ();
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16420: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20354: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:16423: \$? = $ac_status" >&5
+ echo "$as_me:20357: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:16426: \"$ac_try\"") >&5
+ { (eval echo "$as_me:20360: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:16429: \$? = $ac_status" >&5
+ echo "$as_me:20363: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_dbmalloc_debug_malloc=yes
else
@@ -16437,7 +20371,7 @@ fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-echo "$as_me:16440: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:20374: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
cat >>confdefs.h <<EOF
@@ -16452,7 +20386,7 @@ fi
fi
-echo "$as_me:16455: checking if you want to use valgrind for testing" >&5
+echo "$as_me:20389: checking if you want to use valgrind for testing" >&5
echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
# Check whether --with-valgrind or --without-valgrind was given.
@@ -16469,15 +20403,15 @@ EOF
else
with_valgrind=
fi;
-echo "$as_me:16472: result: ${with_valgrind:-no}" >&5
+echo "$as_me:20406: result: ${with_valgrind:-no}" >&5
echo "${ECHO_T}${with_valgrind:-no}" >&6
-case .$with_cflags in #(vi
-.*-g*)
- case .$CFLAGS in #(vi
- .*-g*) #(vi
+case .$with_cflags in
+(.*-g*)
+ case .$CFLAGS in
+ (.*-g*)
;;
- *)
+ (*)
cf_fix_cppflags=no
cf_new_cflags=
@@ -16487,11 +20421,11 @@ cf_new_extra_cppflags=
for cf_add_cflags in -g
do
case $cf_fix_cppflags in
-no)
- case $cf_add_cflags in #(vi
- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+ case $cf_add_cflags in
+ (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
case $cf_add_cflags in
- -D*)
+ (-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
@@ -16499,20 +20433,26 @@ no)
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
+
continue
fi
;;
esac
case "$CPPFLAGS" in
- *$cf_add_cflags) #(vi
+ (*$cf_add_cflags)
;;
- *) #(vi
- case $cf_add_cflags in #(vi
- -D*)
+ (*)
+ case $cf_add_cflags in
+ (-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CPPFLAGS=`echo "$CPPFLAGS" | \
@@ -16521,17 +20461,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \
;;
esac
- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+
+ test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
+ cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
+
;;
esac
;;
- *)
- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ (*)
+
+ test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
+ cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
+
;;
esac
;;
-yes)
- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+(yes)
+
+ test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
+ cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
@@ -16544,17 +20492,23 @@ done
if test -n "$cf_new_cflags" ; then
- CFLAGS="$CFLAGS $cf_new_cflags"
+ test -n "$CFLAGS" && CFLAGS="$CFLAGS "
+ CFLAGS="${CFLAGS}$cf_new_cflags"
+
fi
if test -n "$cf_new_cppflags" ; then
- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+ test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
+ CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
+
fi
if test -n "$cf_new_extra_cppflags" ; then
- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+ test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
+ EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
+
fi
;;
@@ -16562,7 +20516,7 @@ fi
;;
esac
-echo "$as_me:16565: checking if you want to perform memory-leak testing" >&5
+echo "$as_me:20519: checking if you want to perform memory-leak testing" >&5
echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
# Check whether --enable-leaks or --disable-leaks was given.
@@ -16572,7 +20526,7 @@ if test "${enable_leaks+set}" = set; then
else
: ${with_no_leaks:=no}
fi;
-echo "$as_me:16575: result: $with_no_leaks" >&5
+echo "$as_me:20529: result: $with_no_leaks" >&5
echo "${ECHO_T}$with_no_leaks" >&6
if test "$with_no_leaks" = yes ; then
@@ -16588,68 +20542,70 @@ EOF
fi
LD_RPATH_OPT=
-echo "$as_me:16591: checking for an rpath option" >&5
+if test "x$cf_cv_enable_rpath" != xno
+then
+ echo "$as_me:20547: checking for an rpath option" >&5
echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
-case $cf_cv_system_name in #(vi
-irix*) #(vi
- if test "$GCC" = yes; then
+ case $cf_cv_system_name in
+ (irix*)
+ if test "$GCC" = yes; then
+ LD_RPATH_OPT="-Wl,-rpath,"
+ else
+ LD_RPATH_OPT="-rpath "
+ fi
+ ;;
+ (linux*|gnu*|k*bsd*-gnu|freebsd*)
LD_RPATH_OPT="-Wl,-rpath,"
- else
+ ;;
+ (openbsd[2-9].*|mirbsd*)
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+ (dragonfly*)
LD_RPATH_OPT="-rpath "
- fi
- ;;
-linux*|gnu*|k*bsd*-gnu) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-openbsd[2-9].*|mirbsd*) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-dragonfly*|freebsd*) #(vi
- LD_RPATH_OPT="-rpath "
- ;;
-netbsd*) #(vi
- LD_RPATH_OPT="-Wl,-rpath,"
- ;;
-osf*|mls+*) #(vi
- LD_RPATH_OPT="-rpath "
- ;;
-solaris2*) #(vi
- LD_RPATH_OPT="-R"
- ;;
-*)
- ;;
-esac
-echo "$as_me:16622: result: $LD_RPATH_OPT" >&5
+ ;;
+ (netbsd*)
+ LD_RPATH_OPT="-Wl,-rpath,"
+ ;;
+ (osf*|mls+*)
+ LD_RPATH_OPT="-rpath "
+ ;;
+ (solaris2*)
+ LD_RPATH_OPT="-R"
+ ;;
+ (*)
+ ;;
+ esac
+ echo "$as_me:20578: result: $LD_RPATH_OPT" >&5
echo "${ECHO_T}$LD_RPATH_OPT" >&6
-case "x$LD_RPATH_OPT" in #(vi
-x-R*)
- echo "$as_me:16627: checking if we need a space after rpath option" >&5
+ case "x$LD_RPATH_OPT" in
+ (x-R*)
+ echo "$as_me:20583: checking if we need a space after rpath option" >&5
echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
- cf_save_LIBS="$LIBS"
+ cf_save_LIBS="$LIBS"
-cf_add_libs="${LD_RPATH_OPT}$libdir"
-# Filter out duplicates - this happens with badly-designed ".pc" files...
-for cf_add_1lib in $LIBS
-do
- for cf_add_2lib in $cf_add_libs
- do
- if test "x$cf_add_1lib" = "x$cf_add_2lib"
- then
+cf_add_libs="$LIBS"
+# reverse order
+cf_add_0lib=
+for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
+# filter duplicates
+for cf_add_1lib in $cf_add_0lib; do
+ for cf_add_2lib in $cf_add_libs; do
+ if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
cf_add_1lib=
break
fi
done
- test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+ test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
done
LIBS="$cf_add_libs"
- cat >conftest.$ac_ext <<_ACEOF
-#line 16648 "configure"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 20604 "configure"
#include "confdefs.h"
int
-main ()
+main (void)
{
;
@@ -16657,16 +20613,16 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16660: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20616: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:16663: \$? = $ac_status" >&5
+ echo "$as_me:20619: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:16666: \"$ac_try\"") >&5
+ { (eval echo "$as_me:20622: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:16669: \$? = $ac_status" >&5
+ echo "$as_me:20625: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_rpath_space=no
else
@@ -16675,45 +20631,46 @@ cat conftest.$ac_ext >&5
cf_rpath_space=yes
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
- LIBS="$cf_save_LIBS"
- echo "$as_me:16679: result: $cf_rpath_space" >&5
+ LIBS="$cf_save_LIBS"
+ echo "$as_me:20635: result: $cf_rpath_space" >&5
echo "${ECHO_T}$cf_rpath_space" >&6
- test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
- ;;
-esac
+ test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+ ;;
+ esac
+fi
-echo "$as_me:16685: checking if rpath-hack should be disabled" >&5
+echo "$as_me:20642: checking if rpath-hack should be disabled" >&5
echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
# Check whether --enable-rpath-hack or --disable-rpath-hack was given.
if test "${enable_rpath_hack+set}" = set; then
enableval="$enable_rpath_hack"
test "$enableval" != no && enableval=yes
- if test "$enableval" != "yes" ; then
+ if test "$enableval" != "yes" ; then
cf_disable_rpath_hack=yes
- else
- cf_disable_rpath_hack=no
- fi
+ else
+ cf_disable_rpath_hack=no
+ fi
else
enableval=yes
- cf_disable_rpath_hack=no
+ cf_disable_rpath_hack=no
fi;
-echo "$as_me:16702: result: $cf_disable_rpath_hack" >&5
+echo "$as_me:20659: result: $cf_disable_rpath_hack" >&5
echo "${ECHO_T}$cf_disable_rpath_hack" >&6
if test "$cf_disable_rpath_hack" = no ; then
-echo "$as_me:16706: checking for updated LDFLAGS" >&5
+echo "$as_me:20663: checking for updated LDFLAGS" >&5
echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
if test -n "$LD_RPATH_OPT" ; then
- echo "$as_me:16709: result: maybe" >&5
+ echo "$as_me:20666: result: maybe" >&5
echo "${ECHO_T}maybe" >&6
for ac_prog in ldd
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:16716: checking for $ac_word" >&5
+echo "$as_me:20673: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16728,7 +20685,7 @@ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
$as_executable_p "$ac_dir/$ac_word" || continue
ac_cv_prog_cf_ldd_prog="$ac_prog"
-echo "$as_me:16731: found $ac_dir/$ac_word" >&5
+echo "$as_me:20688: found $ac_dir/$ac_word" >&5
break
done
@@ -16736,10 +20693,10 @@ fi
fi
cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
if test -n "$cf_ldd_prog"; then
- echo "$as_me:16739: result: $cf_ldd_prog" >&5
+ echo "$as_me:20696: result: $cf_ldd_prog" >&5
echo "${ECHO_T}$cf_ldd_prog" >&6
else
- echo "$as_me:16742: result: no" >&5
+ echo "$as_me:20699: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -16753,11 +20710,11 @@ test -n "$cf_ldd_prog" || cf_ldd_prog="no"
cf_rpath_oops=
cat >conftest.$ac_ext <<_ACEOF
-#line 16756 "configure"
+#line 20713 "configure"
#include "confdefs.h"
#include <stdio.h>
int
-main ()
+main (void)
{
printf("Hello");
;
@@ -16765,16 +20722,16 @@ printf("Hello");
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:16768: \"$ac_link\"") >&5
+if { (eval echo "$as_me:20725: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
- echo "$as_me:16771: \$? = $ac_status" >&5
+ echo "$as_me:20728: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:16774: \"$ac_try\"") >&5
+ { (eval echo "$as_me:20731: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
- echo "$as_me:16777: \$? = $ac_status" >&5
+ echo "$as_me:20734: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
@@ -16802,7 +20759,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
then
test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
-echo "${as_me:-configure}:16805: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
+echo "${as_me:-configure}:20762: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
break
@@ -16814,17 +20771,17 @@ echo "${as_me:-configure}:16805: testing ...adding -L$cf_rpath_dir/lib to LDFLAG
test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
-echo "${as_me:-configure}:16817: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6
-echo "${as_me:-configure}:16821: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20778: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
cf_rpath_dst=
for cf_rpath_src in $LDFLAGS
do
- case $cf_rpath_src in #(vi
- -L*) #(vi
+ case $cf_rpath_src in
+ (-L*)
# check if this refers to a directory which we will ignore
cf_rpath_skip=no
@@ -16855,7 +20812,7 @@ do
then
test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
-echo "${as_me:-configure}:16858: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20815: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
fi
@@ -16868,17 +20825,17 @@ LDFLAGS=$cf_rpath_dst
test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6
-echo "${as_me:-configure}:16871: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20828: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6
-echo "${as_me:-configure}:16875: testing ...checking LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20832: testing ...checking LIBS $LIBS ..." 1>&5
cf_rpath_dst=
for cf_rpath_src in $LIBS
do
- case $cf_rpath_src in #(vi
- -L*) #(vi
+ case $cf_rpath_src in
+ (-L*)
# check if this refers to a directory which we will ignore
cf_rpath_skip=no
@@ -16909,7 +20866,7 @@ do
then
test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
-echo "${as_me:-configure}:16912: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+echo "${as_me:-configure}:20869: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
fi
@@ -16922,14 +20879,14 @@ LIBS=$cf_rpath_dst
test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6
-echo "${as_me:-configure}:16925: testing ...checked LIBS $LIBS ..." 1>&5
+echo "${as_me:-configure}:20882: testing ...checked LIBS $LIBS ..." 1>&5
test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
-echo "${as_me:-configure}:16929: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+echo "${as_me:-configure}:20886: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
else
- echo "$as_me:16932: result: no" >&5
+ echo "$as_me:20889: result: no" >&5
echo "${ECHO_T}no" >&6
fi
@@ -17019,7 +20976,7 @@ DEFS=-DHAVE_CONFIG_H
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:17022: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:20979: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
@@ -17151,7 +21108,7 @@ EOF
cat >>$CONFIG_STATUS <<EOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.52.20141204,
+configured by $0, generated by GNU Autoconf 2.52.20200111,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -17195,7 +21152,7 @@ cat >>$CONFIG_STATUS <<\EOF
echo "$ac_cs_version"; exit 0 ;;
--he | --h)
# Conflict between --help and --header
- { { echo "$as_me:17198: error: ambiguous option: $1
+ { { echo "$as_me:21155: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
@@ -17214,7 +21171,7 @@ Try \`$0 --help' for more information." >&2;}
ac_need_defaults=false;;
# This is an error.
- -*) { { echo "$as_me:17217: error: unrecognized option: $1
+ -*) { { echo "$as_me:21174: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
@@ -17233,7 +21190,7 @@ cat >&5 << _ACEOF
## Running config.status. ##
## ----------------------- ##
-This file was extended by $as_me 2.52.20141204, executed with
+This file was extended by $as_me 2.52.20200111, executed with
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
@@ -17264,7 +21221,7 @@ do
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
"ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
- *) { { echo "$as_me:17267: error: invalid argument: $ac_config_target" >&5
+ *) { { echo "$as_me:21224: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
@@ -17328,6 +21285,7 @@ s,@datadir@,$datadir,;t t
s,@sysconfdir@,$sysconfdir,;t t
s,@sharedstatedir@,$sharedstatedir,;t t
s,@localstatedir@,$localstatedir,;t t
+s,@runstatedir@,$runstatedir,;t t
s,@libdir@,$libdir,;t t
s,@includedir@,$includedir,;t t
s,@oldincludedir@,$oldincludedir,;t t
@@ -17369,6 +21327,8 @@ s,@AWK@,$AWK,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
+s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
s,@LINT@,$LINT,;t t
s,@LINT_OPTS@,$LINT_OPTS,;t t
s,@CTAGS@,$CTAGS,;t t
@@ -17388,11 +21348,13 @@ s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
s,@LD_MODEL@,$LD_MODEL,;t t
s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
s,@LIB_CLEAN@,$LIB_CLEAN,;t t
s,@LIB_COMPILE@,$LIB_COMPILE,;t t
s,@LIB_LINK@,$LIB_LINK,;t t
s,@LINK_TESTS@,$LINK_TESTS,;t t
s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
+s,@PACKAGE@,$PACKAGE,;t t
s,@PTHREAD@,$PTHREAD,;t t
s,@TEST_ARGS@,$TEST_ARGS,;t t
s,@TEST_DEPS@,$TEST_DEPS,;t t
@@ -17418,6 +21380,8 @@ s,@X_LIBS@,$X_LIBS,;t t
s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
+s,@RGB_PATH@,$RGB_PATH,;t t
+s,@no_x11_rgb@,$no_x11_rgb,;t t
s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
s,@cf_ldd_prog@,$cf_ldd_prog,;t t
s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
@@ -17449,10 +21413,28 @@ EOF
# These are the two extra sed commands mentioned above.
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ # It is possible to make a multiline substitution using escaped newlines.
+ # Ensure that we do not split the substitution between script fragments.
+ ac_BEG=$ac_end
+ ac_END=`expr $ac_end + $ac_max_sed_lines`
+ sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
+ if test -s $tmp/subs.next; then
+ grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
+ if test ! -s $tmp/subs.edit; then
+ grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
+ if test ! -s $tmp/subs.edit; then
+ if test $ac_beg -gt 1; then
+ ac_end=`expr $ac_end - 1`
+ continue
+ fi
+ fi
+ fi
+ fi
+
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
@@ -17535,7 +21517,7 @@ done; }
esac
if test x"$ac_file" != x-; then
- { echo "$as_me:17538: creating $ac_file" >&5
+ { echo "$as_me:21520: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
rm -f "$ac_file"
fi
@@ -17553,7 +21535,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:17556: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:21538: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -17566,7 +21548,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:17569: error: cannot find input file: $f" >&5
+ { { echo "$as_me:21551: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -17582,7 +21564,7 @@ cat >>$CONFIG_STATUS <<\EOF
if test -n "$ac_seen"; then
ac_used=`grep '@datarootdir@' $ac_item`
if test -z "$ac_used"; then
- { echo "$as_me:17585: WARNING: datarootdir was used implicitly but not set:
+ { echo "$as_me:21567: WARNING: datarootdir was used implicitly but not set:
$ac_seen" >&5
echo "$as_me: WARNING: datarootdir was used implicitly but not set:
$ac_seen" >&2;}
@@ -17591,7 +21573,7 @@ $ac_seen" >&2;}
fi
ac_seen=`grep '${datarootdir}' $ac_item`
if test -n "$ac_seen"; then
- { echo "$as_me:17594: WARNING: datarootdir was used explicitly but not set:
+ { echo "$as_me:21576: WARNING: datarootdir was used explicitly but not set:
$ac_seen" >&5
echo "$as_me: WARNING: datarootdir was used explicitly but not set:
$ac_seen" >&2;}
@@ -17628,7 +21610,7 @@ s,@INSTALL@,$ac_INSTALL,;t t
ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file`
if test -z "$ac_init"; then
ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
- { echo "$as_me:17631: WARNING: Variable $ac_name is used but was not set:
+ { echo "$as_me:21613: WARNING: Variable $ac_name is used but was not set:
$ac_seen" >&5
echo "$as_me: WARNING: Variable $ac_name is used but was not set:
$ac_seen" >&2;}
@@ -17639,7 +21621,7 @@ $ac_seen" >&2;}
egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
if test -s $tmp/out; then
ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
- { echo "$as_me:17642: WARNING: Some variables may not be substituted:
+ { echo "$as_me:21624: WARNING: Some variables may not be substituted:
$ac_seen" >&5
echo "$as_me: WARNING: Some variables may not be substituted:
$ac_seen" >&2;}
@@ -17688,7 +21670,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
* ) ac_file_in=$ac_file.in ;;
esac
- test x"$ac_file" != x- && { echo "$as_me:17691: creating $ac_file" >&5
+ test x"$ac_file" != x- && { echo "$as_me:21673: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
# First look for the input files in the build tree, otherwise in the
@@ -17699,7 +21681,7 @@ echo "$as_me: creating $ac_file" >&6;}
-) echo $tmp/stdin ;;
[\\/$]*)
# Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:17702: error: cannot find input file: $f" >&5
+ test -f "$f" || { { echo "$as_me:21684: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
echo $f;;
@@ -17712,7 +21694,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
echo $srcdir/$f
else
# /dev/null tree
- { { echo "$as_me:17715: error: cannot find input file: $f" >&5
+ { { echo "$as_me:21697: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
fi;;
@@ -17770,7 +21752,7 @@ cat >>$CONFIG_STATUS <<\EOF
rm -f $tmp/in
if test x"$ac_file" != x-; then
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
- { echo "$as_me:17773: $ac_file is unchanged" >&5
+ { echo "$as_me:21755: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -17847,7 +21829,7 @@ do
\$(srcdir)/test.priv.h \\
ncurses_cfg.h
$SHOW_CC
- $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
+ $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
TEST_EOF
done
diff --git a/test/configure.in b/test/configure.in
index d99456a..08350e7 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -1,5 +1,6 @@
dnl***************************************************************************
-dnl Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+dnl Copyright 2018-2019,2020 Thomas E. Dickey *
+dnl Copyright 1998-2017,2018 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@@ -26,9 +27,9 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
-dnl Author: Thomas E. Dickey 1996, etc.
+dnl Author: Thomas E. Dickey 1996-on
dnl
-dnl $Id: configure.in,v 1.117 2014/09/20 21:03:23 tom Exp $
+dnl $Id: configure.in,v 1.157 2020/02/02 23:34:34 tom Exp $
dnl This is a simple configuration-script for the ncurses test programs that
dnl allows the test-directory to be separately configured against a reference
dnl system (i.e., sysvr4 curses)
@@ -36,9 +37,12 @@ dnl
dnl If you're configuring ncurses, you shouldn't need to use this script.
dnl It's only for testing purposes.
dnl
-dnl See http://invisible-island.net/autoconf/ for additional information.
+dnl For additional information, see
+dnl https://invisible-island.net/autoconf/
+dnl https://invisible-island.net/autoconf/my-autoconf.html
+dnl https://invisible-island.net/ncurses/ncurses-examples.html
dnl ---------------------------------------------------------------------------
-AC_PREREQ(2.52.20030208)
+AC_PREREQ(2.52.20200111)
AC_INIT(ncurses.c)
AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin)
@@ -48,11 +52,15 @@ CF_CHECK_CACHE
AC_ARG_PROGRAM
+CF_HELP_MESSAGE(General Options:)
+
AC_PROG_MAKE_SET
CF_PROG_CC
+AC_C_INLINE
AC_PROG_CPP
AC_PROG_AWK
CF_PROG_INSTALL
+CF_INSTALL_OPTS
CF_PROG_LINT
CF_MAKE_TAGS
@@ -73,11 +81,13 @@ LDFLAGS_STATIC="" AC_SUBST(LDFLAGS_STATIC)
LD_MODEL="" AC_SUBST(LD_MODEL)
LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS)
LIBTOOL="" AC_SUBST(LIBTOOL)
+LIBTOOL_OPTS="" AC_SUBST(LIBTOOL_OPTS)
LIB_CLEAN="" AC_SUBST(LIB_CLEAN)
LIB_COMPILE="" AC_SUBST(LIB_COMPILE)
LIB_LINK='${CC}' AC_SUBST(LIB_LINK)
LINK_TESTS="" AC_SUBST(LINK_TESTS)
LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS)
+PACKAGE="ncurses-examples" AC_SUBST(PACKAGE)
PTHREAD="-lm" AC_SUBST(PTHREAD)
TEST_ARGS="" AC_SUBST(TEST_ARGS)
TEST_DEPS="" AC_SUBST(TEST_DEPS)
@@ -95,11 +105,17 @@ AC_EXEEXT
AC_OBJEXT
CF_GCC_ATTRIBUTES
-CF_XOPEN_SOURCE
+CF_ENABLE_STRING_HACKS
+CF_XOPEN_SOURCE(600)
CF_SIG_ATOMIC_T
+# Work around breakage on OS X
+CF_SIGWINCH
+
+# Checks for CODESET support.
+AM_LANGINFO_CODESET
+
dnl ---------------------------------------------------------------------------
-CF_HELP_MESSAGE(General Options:)
CF_PKG_CONFIG
CF_DISABLE_ECHO
@@ -120,44 +136,102 @@ CF_HELP_MESSAGE(Curses Version-dependent Options:)
CF_WITH_NCURSES_ETC
case $cf_cv_screen in
-curses|curses_*)
- CF_NETBSD_FORM_H
- CF_NETBSD_MENU_H
- ;;
-ncursesw)
- cf_cv_libtype=w
+(ncurses*)
+ cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
;;
esac
+CF_WITH_X11_RGB
+
dnl If we've not specified a library, assume we're using sysvr4 libraries
dnl installed conventionally (e.g., SunOS 5.x - solaris).
dnl Autoconf builds up the $LIBS in reverse order
-case $cf_cv_screen in #(vi
-pdcurses) #(vi
+cf_curses_headers=
+
+case $cf_cv_screen in
+(pdcurses)
+ cf_default_panel=no
+ cf_default_form=no
+ cf_default_menu=no
+ cf_default_tinfo=no
+ ;;
+(xcurses|bsdcurses)
+ cf_default_panel=no
+ cf_default_form=no
+ cf_default_menu=no
+ cf_default_tinfo=yes
;;
-*)
- # look for curses-related libraries
- : ${cf_panel_lib:=panel}
- : ${cf_menu_lib:=menu}
- : ${cf_form_lib:=form}
- AC_CHECK_LIB($cf_panel_lib$cf_cv_libtype,new_panel)
- AC_CHECK_LIB($cf_menu_lib$cf_cv_libtype,menu_driver)
- AC_CHECK_LIB($cf_form_lib$cf_cv_libtype,form_driver)
-
- # look for curses-related headers
- AC_CHECK_HEADERS( \
- nc_alloc.h \
- nomacros.h \
- form.h \
- menu.h \
- panel.h \
- term_entry.h \
- )
+(*)
+ cf_default_panel=yes
+ cf_default_form=yes
+ cf_default_menu=yes
+ cf_default_tinfo=yes
+ case $cf_cv_screen in
+ (ncurses*)
+ cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
+ ;;
+ esac
;;
esac
+AC_MSG_CHECKING(if you want to check for panel functions)
+CF_ARG_DISABLE(panel,
+ [ --disable-panel disable checks for panel functions],
+ cf_enable_panel=no,
+ cf_enable_panel=$cf_default_panel,
+ yes)
+AC_MSG_RESULT($cf_enable_panel)
+if test $cf_enable_panel = yes
+then
+ CF_CHECK_CURSES_LIB(panel,$cf_cv_libtype,new_panel,0)
+ cf_curses_headers="$cf_curses_headers panel.h"
+fi
+
+AC_MSG_CHECKING(if you want to check for menu functions)
+CF_ARG_DISABLE(menu,
+ [ --disable-menu disable checks for menu functions],
+ cf_enable_menu=no,
+ cf_enable_menu=$cf_default_menu,
+ yes)
+AC_MSG_RESULT($cf_enable_menu)
+if test $cf_enable_menu = yes
+then
+ case $cf_cv_screen in
+ (ncurses*)
+ ;;
+ (curses*)
+ CF_NETBSD_MENU_H
+ ;;
+ esac
+ CF_CHECK_CURSES_LIB(menu,$cf_cv_libtype,menu_driver,[0,0])
+ cf_curses_headers="$cf_curses_headers menu.h"
+fi
+
+AC_MSG_CHECKING(if you want to check for form functions)
+CF_ARG_DISABLE(form,
+ [ --disable-form disable checks for form functions],
+ cf_enable_form=no,
+ cf_enable_form=$cf_default_form,
+ yes)
+AC_MSG_RESULT($cf_enable_form)
+if test $cf_enable_form = yes
+then
+ case $cf_cv_screen in
+ (ncurses*)
+ ;;
+ (curses*)
+ CF_NETBSD_FORM_H
+ ;;
+ esac
+ CF_CHECK_CURSES_LIB(form,$cf_cv_libtype,form_driver,[0,0])
+ cf_curses_headers="$cf_curses_headers form.h"
+fi
+
+# look for curses-related headers
+AC_CHECK_HEADERS( $cf_curses_headers )
+
AC_STDC_HEADERS
AC_HEADER_TIME
AC_CHECK_HEADERS( \
@@ -165,6 +239,7 @@ getopt.h \
locale.h \
math.h \
stdarg.h \
+stdint.h \
sys/ioctl.h \
sys/select.h \
sys/time.h \
@@ -177,8 +252,46 @@ CF_GETOPT_HEADER
AC_CHECK_FUNCS( \
getopt \
gettimeofday \
+strstr \
+tsearch \
)
+# use a compile-check to work with ncurses*-config and subdirectory includes
+AC_CACHE_CHECK(if we can use termcap.h,cf_cv_have_termcap_h,[
+ AC_TRY_COMPILE([
+#include <curses.h>
+#ifdef NCURSES_VERSION
+#undef NCURSES_VERSION
+#endif
+#include <termcap.h>
+#ifndef NCURSES_VERSION
+#error wrong header
+#endif
+],
+ [return 0;],
+ [cf_cv_have_termcap_h=yes],
+ [cf_cv_have_termcap_h=no])])
+if test "x$cf_cv_have_termcap_h" = xyes
+then
+ AC_DEFINE(HAVE_TERMCAP_H,1,[Define to 1 if we can use termcap.h])
+else
+AC_CACHE_CHECK(if we can use ncurses/termcap.h,cf_cv_have_ncurses_termcap_h,[
+ AC_TRY_COMPILE([
+#include <ncurses/curses.h>
+#ifdef NCURSES_VERSION
+#undef NCURSES_VERSION
+#endif
+#include <ncurses/termcap.h>
+#ifndef NCURSES_VERSION
+#error wrong header
+#endif
+],
+ [return 0;],
+ [cf_cv_have_ncurses_termcap_h=yes],
+ [cf_cv_have_ncurses_termcap_h=no])])
+test "x$cf_cv_have_ncurses_termcap_h" = xyes && AC_DEFINE(HAVE_NCURSES_TERMCAP_H,1,[Define to 1 if we can use ncurses/termcap.h])
+fi
+
if test "x$ac_cv_func_getopt" = xno; then
AC_MSG_ERROR(getopt is required for building programs)
fi
@@ -197,9 +310,14 @@ wcstombs \
fi
CF_CURSES_FUNCS( \
+alloc_pair \
assume_default_colors \
chgat \
+color_content \
color_set \
+copywin \
+delscreen \
+dupwin \
filter \
getbegx \
getcurx \
@@ -207,12 +325,19 @@ getmaxx \
getnstr \
getparx \
getwin \
+halfdelay \
+init_extended_color \
+mvderwin \
mvvline \
+mvwin \
mvwvline \
napms \
+newpad \
putwin \
+reset_color_pairs \
resize_term \
resizeterm \
+restartterm \
ripoffline \
scr_dump \
setupterm \
@@ -222,6 +347,7 @@ termattrs \
tgetent \
tigetnum \
tigetstr \
+tputs_sp \
typeahead \
use_default_colors \
use_env \
@@ -233,9 +359,11 @@ vidputs \
vsscanf \
vw_printw \
wchgat \
+winsdelln \
winsstr \
wresize \
wsyncdown \
+_tracef \
)
CF_TPUTS_PROTO
@@ -288,7 +416,32 @@ else
AC_DEFINE(USE_WIDEC_SUPPORT,0)
fi
+AC_CACHE_CHECK(if $cf_cv_screen library uses pthreads,cf_cv_use_pthreads,[
+AC_TRY_LINK([
+#include <${cf_cv_ncurses_header:-curses.h}>
+extern void _nc_init_pthreads(void);
+],
+[
+ initscr();
+ _nc_init_pthreads();
+ ],
+ [cf_cv_use_pthreads=yes],
+ [cf_cv_use_pthreads=no])
+])
+test $cf_cv_use_pthreads = yes && AC_DEFINE(USE_PTHREADS,1,[Define to 1 if $cf_cv_screen library uses pthreads])
+
CF_SYS_TIME_SELECT
+
+# special check for test/ditto.c
+CF_FUNC_OPENPTY
+if test "$cf_cv_func_openpty" != no ; then
+ AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>,[Define to actual header for openpty function])
+ AC_DEFINE(USE_XTERM_PTY,1,[Define to 1 if we should assume xterm pseudoterminal interface])
+ if test "x$cf_cv_lib_util" = xyes ; then
+ CF_ADD_LIB(util,TEST_LIBS)
+ fi
+fi
+
CF_FUNC_CURSES_VERSION
CF_CURSES_ACS_MAP
@@ -317,12 +470,17 @@ if test "$cf_enable_widec" = yes; then
fi
fi
-CF_CURSES_CHECK_DATA(boolnames)
-CF_CURSES_CHECK_DATA(boolfnames)
+CF_CURSES_CHECK_DATA(\
+TABSIZE \
+curscr \
+ospeed \
+boolnames \
+boolfnames \
+ttytype)
dnl ---------------------------------------------------------------------------
CF_HELP_MESSAGE(Testing/development Options:)
-CF_ENABLE_WARNINGS
+CF_ENABLE_WARNINGS(Wno-unknown-pragmas)
CF_DISABLE_LEAKS
CF_DISABLE_RPATH_HACK
@@ -349,7 +507,7 @@ do
\$(srcdir)/test.priv.h \\
ncurses_cfg.h
$SHOW_CC
- $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
+ $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
TEST_EOF
done
diff --git a/test/demo_altkeys.c b/test/demo_altkeys.c
index f2b07b1..fb3cd65 100644
--- a/test/demo_altkeys.c
+++ b/test/demo_altkeys.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2005-2006,2008 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2005-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,27 +27,17 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_altkeys.c,v 1.9 2010/11/14 00:59:26 tom Exp $
+ * $Id: demo_altkeys.c,v 1.14 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2005/10/22
*/
+#define NEED_TIME_H
#include <test.priv.h>
#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#define MY_LOGFILE "demo_altkeys.log"
#define MY_KEYS (KEY_MAX + 1)
@@ -57,11 +48,12 @@ static void
log_last_line(WINDOW *win)
{
FILE *fp;
- int y, x, n;
- char temp[256];
if ((fp = fopen(MY_LOGFILE, "a")) != 0) {
+ char temp[256];
+ int y, x, n;
int need = sizeof(temp) - 1;
+
if (need > COLS)
need = COLS;
getyx(win, y, x);
@@ -85,13 +77,15 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
int n;
int ch;
#if HAVE_GETTIMEOFDAY
- int secs, msecs;
- struct timeval current, previous;
+ struct timeval previous;
#endif
unlink(MY_LOGFILE);
- newterm(0, stdout, stdin);
+ if (newterm(0, stdout, stdin) == 0) {
+ fprintf(stderr, "Cannot initialize terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
@@ -104,14 +98,15 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
*/
for (n = 0; n < 255; ++n) {
char temp[10];
- sprintf(temp, "\033%c", n);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "\033%c", n);
define_key(temp, n + MY_KEYS);
}
for (n = KEY_MIN; n < KEY_MAX; ++n) {
char *value;
if ((value = keybound(n, 0)) != 0) {
- char *temp = typeMalloc(char, strlen(value) + 2);
- sprintf(temp, "\033%s", value);
+ size_t need = strlen(value) + 2;
+ char *temp = typeMalloc(char, need);
+ _nc_SPRINTF(temp, _nc_SLIMIT(need) "\033%s", value);
define_key(temp, n + MY_KEYS);
free(temp);
free(value);
@@ -125,8 +120,10 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
while ((ch = getch()) != ERR) {
bool escaped = (ch >= MY_KEYS);
const char *name = keyname(escaped ? (ch - MY_KEYS) : ch);
-
#if HAVE_GETTIMEOFDAY
+ int secs, msecs;
+ struct timeval current;
+
gettimeofday(&current, 0);
secs = (int) (current.tv_sec - previous.tv_sec);
msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000);
diff --git a/test/demo_defkey.c b/test/demo_defkey.c
index 045c2c7..ea6c522 100644
--- a/test/demo_defkey.c
+++ b/test/demo_defkey.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2002-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2002-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_defkey.c,v 1.22 2013/09/28 22:02:17 tom Exp $
+ * $Id: demo_defkey.c,v 1.30 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2002/11/23
@@ -45,10 +46,10 @@ static void
log_last_line(WINDOW *win)
{
FILE *fp;
- int y, x, n;
- char temp[256];
if ((fp = fopen(MY_LOGFILE, "a")) != 0) {
+ char temp[256];
+ int y, x, n;
int need = sizeof(temp) - 1;
if (need > COLS)
need = COLS;
@@ -78,15 +79,15 @@ visichar(int ch)
ch = UChar(ch);
assert(ch >= 0 && ch < 256);
if (ch == '\\') {
- strcpy(temp, "\\\\");
+ _nc_STRCPY(temp, "\\\\", sizeof(temp));
} else if (ch == '\033') {
- strcpy(temp, "\\E");
+ _nc_STRCPY(temp, "\\E", sizeof(temp));
} else if (ch < ' ') {
- sprintf(temp, "\\%03o", ch);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "\\%03o", ch);
} else if (ch >= 127) {
- sprintf(temp, "\\%03o", ch);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "\\%03o", ch);
} else {
- sprintf(temp, "%c", ch);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "%c", ch);
}
return temp;
}
@@ -98,19 +99,21 @@ static char *
visible(const char *string)
{
char *result = 0;
- size_t need = 1;
- int pass;
- int n;
if (string != 0 && *string != '\0') {
+ int pass;
+ int n;
+ size_t need = 1;
+
for (pass = 0; pass < 2; ++pass) {
for (n = 0; string[n] != '\0'; ++n) {
char temp[80];
- strncpy(temp, visichar(string[n]), sizeof(temp) - 2);
- if (pass)
- strcat(result, temp);
- else
+ _nc_STRNCPY(temp, visichar(string[n]), sizeof(temp) - 2);
+ if (pass) {
+ _nc_STRCAT(result, temp, need);
+ } else {
need += strlen(temp);
+ }
}
if (!pass)
result = typeCalloc(char, need);
@@ -131,7 +134,7 @@ really_define_key(WINDOW *win, const char *new_string, int code)
char temp[80];
if (code_name == 0) {
- sprintf(temp, "Keycode %d", code);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "Keycode %d", code);
code_name = temp;
}
@@ -184,15 +187,16 @@ duplicate(WINDOW *win, NCURSES_CONST char *name, int code)
if (value != 0) {
const char *prefix = 0;
- char temp[BUFSIZ];
- if (!strncmp(value, "\033[", (size_t) 2)) {
+ if (!(strncmp) (value, "\033[", (size_t) 2)) {
prefix = "\033O";
- } else if (!strncmp(value, "\033O", (size_t) 2)) {
+ } else if (!(strncmp) (value, "\033O", (size_t) 2)) {
prefix = "\033[";
}
if (prefix != 0) {
- sprintf(temp, "%s%s", prefix, value + 2);
+ char temp[BUFSIZ];
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "%s%s", prefix, value + 2);
really_define_key(win, temp, code);
}
}
@@ -239,7 +243,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
*/
for (n = 0; n < 12; ++n) {
char name[10];
- sprintf(name, "kf%d", n + 1);
+ _nc_SPRINTF(name, _nc_SLIMIT(sizeof(name)) "kf%d", n + 1);
fkeys[n] = tigetstr(name);
}
for (n = 0; n < 12; ++n) {
@@ -270,7 +274,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
break;
}
endwin();
- ExitProgram(EXIT_FAILURE);
+ ExitProgram(EXIT_SUCCESS);
}
#else
int
diff --git a/test/demo_forms.c b/test/demo_forms.c
index 97125e3..4e01ed5 100644
--- a/test/demo_forms.c
+++ b/test/demo_forms.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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,14 +27,12 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_forms.c,v 1.50 2014/10/10 00:38:00 tom Exp $
+ * $Id: demo_forms.c,v 1.57 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
*/
/*
-TYPE_ENUM -
-TYPE_REGEXP -
dup_field -
field_init -
field_just -
@@ -149,8 +148,8 @@ read_data(const char *filename)
char *value = typeRealloc(char, need, prior);
if (value == 0)
failed("realloc");
- strcat(value, "\n");
- strcat(value, buffer);
+ _nc_STRCAT(value, "\n", need);
+ _nc_STRCAT(value, buffer, need);
my_data[more - 1].value = value;
} else {
more = 0;
@@ -227,7 +226,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 +249,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 +272,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 +289,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,12 +336,9 @@ 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;
- char *buffer;
- int nbuf;
int field_rows, field_cols, field_max;
int currow, curcol;
@@ -357,7 +353,11 @@ show_current_field(WINDOW *win, FORM * form)
if (data_behind(form))
waddstr(win, " behind");
waddch(win, '\n');
+
if ((field = current_field(form)) != 0) {
+ FIELDTYPE *type;
+ int nbuf;
+
wprintw(win, "Page %d%s, Field %d/%d%s:",
form_page(form),
new_page(field) ? "*" : "",
@@ -413,6 +413,7 @@ show_current_field(WINDOW *win, FORM * form)
waddstr(win, "\n");
for (nbuf = 0; nbuf <= 2; ++nbuf) {
+ char *buffer;
if ((buffer = field_buffer(field, nbuf)) != 0) {
wprintw(win, "buffer %d:", nbuf);
(void) wattrset(win, A_REVERSE);
@@ -432,14 +433,14 @@ show_current_field(WINDOW *win, FORM * form)
static void
demo_forms(void)
{
- WINDOW *w;
FORM *form;
FIELD *f[100]; /* will memset to zero */
- int finished = 0, c;
+ int c;
unsigned n = 0;
int pg;
- WINDOW *also;
const char *fname;
+ static const char *my_enum[] =
+ {"first", "second", "third", 0};
#ifdef NCURSES_MOUSE_VERSION
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
@@ -456,7 +457,8 @@ demo_forms(void)
memset(f, 0, sizeof(f));
for (pg = 0; pg < 4; ++pg) {
char label[80];
- sprintf(label, "Sample Form Page %d", pg + 1);
+ _nc_SPRINTF(label, _nc_SLIMIT(sizeof(label))
+ "Sample Form Page %d", pg + 1);
f[n++] = make_label(label, 0, 15);
set_new_page(f[n - 1], TRUE);
@@ -477,23 +479,30 @@ demo_forms(void)
f[n++] = make_field(fname, 3, 34, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
break;
+
case 1:
fname = "Last Name";
f[n++] = make_label(fname, 2, 0);
- f[n++] = make_field(fname, 3, 0, 1, 18);
+ f[n++] = make_field(fname, 3, 0, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
fname = "First Name";
- f[n++] = make_label(fname, 2, 20);
- f[n++] = make_field(fname, 3, 20, 1, 12);
+ f[n++] = make_label(fname, 2, 14);
+ f[n++] = make_field(fname, 3, 14, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
fname = "MI";
- f[n++] = make_label(fname, 2, 34);
- f[n++] = make_field(fname, 3, 34, 1, 1);
+ f[n++] = make_label(fname, 2, 28);
+ f[n++] = make_field(fname, 3, 28, 1, 1);
set_field_pad(f[n - 1], '?');
set_field_type(f[n - 1], TYPE_ALPHA, 1);
+
+ fname = "First/Second/Third";
+ f[n++] = make_label(fname, 2, 32);
+ f[n++] = make_field(fname, 3, 32, 1, 12);
+ set_field_type(f[n - 1], TYPE_ENUM, my_enum, 0, 0);
break;
+
case 2:
fname = "Host Name";
f[n++] = make_label(fname, 2, 0);
@@ -506,20 +515,24 @@ demo_forms(void)
f[n++] = make_field(fname, 3, 26, 1, 16);
set_field_type(f[n - 1], TYPE_IPV4, 1);
#endif
-
break;
case 3:
fname = "Four digits";
f[n++] = make_label(fname, 2, 0);
- f[n++] = make_field(fname, 3, 0, 1, 18);
+ f[n++] = make_field(fname, 3, 0, 1, 10);
set_field_type(f[n - 1], TYPE_INTEGER, 4, 0, 0);
fname = "Numeric";
- f[n++] = make_label(fname, 2, 20);
- f[n++] = make_field(fname, 3, 20, 1, 12);
+ f[n++] = make_label(fname, 2, 13);
+ f[n++] = make_field(fname, 3, 13, 1, 12);
set_field_type(f[n - 1], TYPE_NUMERIC, 3, -10000.0, 100000000.0);
+ fname = "Phone number";
+ f[n++] = make_label(fname, 2, 27);
+ f[n++] = make_field(fname, 3, 27, 1, 16);
+ set_field_type(f[n - 1], TYPE_REGEXP,
+ "^([0-9]-)?[0-9]{3}-[0-9]{3}-[0-9]{4} *$");;
break;
}
@@ -532,6 +545,9 @@ demo_forms(void)
f[n] = (FIELD *) 0;
if ((form = new_form(f)) != 0) {
+ WINDOW *w;
+ WINDOW *also;
+ int finished = 0;
display_form(form);
@@ -558,8 +574,7 @@ demo_forms(void)
free_form(form);
}
for (c = 0; f[c] != 0; c++) {
- void *ptr = field_userptr(f[c]);
- free(ptr);
+ free_edit_field(f[c]);
free_field(f[c]);
}
noraw();
diff --git a/test/demo_keyok.c b/test/demo_keyok.c
index 8724d98..28d90aa 100644
--- a/test/demo_keyok.c
+++ b/test/demo_keyok.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2002-2003,2006 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_keyok.c,v 1.5 2006/11/04 20:09:51 tom Exp $
+ * $Id: demo_keyok.c,v 1.7 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the keyok() function.
* Thomas Dickey - 2002/11/23
@@ -39,6 +40,7 @@ int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
int lastch = ERR;
+ int prior = ERR;
int ch;
WINDOW *win;
@@ -57,6 +59,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>");
diff --git a/test/demo_menus.c b/test/demo_menus.c
index ccd48b0..02f7ca3 100644
--- a/test/demo_menus.c
+++ b/test/demo_menus.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2005-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_menus.c,v 1.54 2014/09/05 08:34:06 tom Exp $
+ * $Id: demo_menus.c,v 1.71 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate a variety of functions from the menu library.
* Thomas Dickey - 2005/4/9
@@ -75,11 +76,8 @@ top_row -
#ifdef NCURSES_VERSION
#ifdef TRACE
static unsigned save_trace = TRACE_ORDINARY | TRACE_CALLS;
-extern unsigned _nc_tracing;
static MENU *mpTrace;
#endif
-#else
-#undef TRACE
#endif
typedef enum {
@@ -114,6 +112,18 @@ static bool loaded_file = FALSE;
static char empty[1];
+#ifdef TRACE
+static void failed(const char *s) GCC_NORETURN;
+
+static void
+failed(const char *s)
+{
+ perror(s);
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
+
/* Common function to allow ^T to toggle trace-mode in the middle of a test
* so that trace-files can be made smaller.
*/
@@ -130,7 +140,7 @@ wGetchar(WINDOW *win)
} else {
_nc_tracing = save_trace;
}
- trace(_nc_tracing);
+ curses_trace(_nc_tracing);
if (_nc_tracing)
Trace(("TOGGLE-TRACING ON"));
}
@@ -186,9 +196,9 @@ menu_offset(MenuNo number)
int result = 0;
if (okMenuNo(number)) {
- int spc_desc, spc_rows, spc_cols;
-
+ int spc_rows;
#ifdef NCURSES_VERSION
+ int spc_desc, spc_cols;
menu_spacing(mpBanner, &spc_desc, &spc_rows, &spc_cols);
#else
spc_rows = 0;
@@ -270,13 +280,6 @@ menu_create(ITEM ** items, int count, int ncols, MenuNo number)
if (mcols + (2 * margin + x) >= COLS)
mcols = COLS - (2 * margin + x);
-#ifdef TRACE
- if (number == eTrace)
- menu_opts_off(result, O_ONEVALUE);
- else
- menu_opts_on(result, O_ONEVALUE);
-#endif
-
menuwin = newwin(mrows + (2 * margin), mcols + (2 * margin), y, x);
set_menu_win(result, menuwin);
keypad(menuwin, TRUE);
@@ -285,6 +288,16 @@ menu_create(ITEM ** items, int count, int ncols, MenuNo number)
set_menu_sub(result, derwin(menuwin, mrows, mcols, margin, margin));
+#ifdef TRACE
+ if (number == eTrace)
+ menu_opts_off(result, O_ONEVALUE);
+ else
+ menu_opts_on(result, O_ONEVALUE);
+#endif
+#if defined(NCURSES_MOUSE_VERSION) && defined(O_MOUSE_MENU)
+ menu_opts_on(result, O_MOUSE_MENU);
+#endif
+
post_menu(result);
set_menu_init(result, my_menu_init);
@@ -297,12 +310,11 @@ menu_create(ITEM ** items, int count, int ncols, MenuNo number)
static void
menu_destroy(MENU * m)
{
- int count;
-
Trace(("menu_destroy %p", (void *) m));
if (m != 0) {
ITEM **items = menu_items(m);
const char *blob = 0;
+ int count;
count = item_count(m);
Trace(("menu_destroy %p count %d", (void *) m, count));
@@ -417,7 +429,6 @@ build_select_menu(MenuNo number, char *filename)
&& (sb.st_mode & S_IFMT) == S_IFREG
&& sb.st_size != 0) {
size_t size = (size_t) sb.st_size;
- unsigned j, k;
char *blob = typeMalloc(char, size + 1);
MENU_DATA *list = typeCalloc(MENU_DATA, size + 1);
@@ -430,6 +441,7 @@ build_select_menu(MenuNo number, char *filename)
if (fp != 0) {
if (fread(blob, sizeof(char), size, fp) == size) {
bool mark = TRUE;
+ unsigned j, k;
for (j = k = 0; j < size; ++j) {
if (mark) {
list[k++].name = blob + j;
@@ -541,27 +553,31 @@ static char *
tracetrace(unsigned tlevel)
{
static char *buf;
+ static size_t need = 12;
int n;
if (buf == 0) {
- size_t need = 12;
for (n = 0; t_tbl[n].name != 0; n++)
need += strlen(t_tbl[n].name) + 2;
buf = typeMalloc(char, need);
+ if (!buf)
+ failed("tracetrace");
}
- sprintf(buf, "0x%02x = {", tlevel);
+ _nc_SPRINTF(buf, _nc_SLIMIT(need) "0x%02x = {", tlevel);
if (tlevel == 0) {
- sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name);
+ _nc_STRCAT(buf, t_tbl[0].name, need);
+ _nc_STRCAT(buf, ", ", need);
} else {
for (n = 1; t_tbl[n].name != 0; n++)
if ((tlevel & t_tbl[n].mask) == t_tbl[n].mask) {
- strcat(buf, t_tbl[n].name);
- strcat(buf, ", ");
+ _nc_STRCAT(buf, t_tbl[n].name, need);
+ _nc_STRCAT(buf, ", ", need);
}
}
if (buf[strlen(buf) - 2] == ',')
buf[strlen(buf) - 2] = '\0';
- return (strcat(buf, "}"));
+ _nc_STRCAT(buf, "}", need);
+ return buf;
}
/* fake a dynamically reconfigurable menu using the 0th entry to deselect
@@ -571,13 +587,14 @@ static bool
update_trace_menu(MENU * m)
{
ITEM **items;
- ITEM *i, **p;
+ ITEM *i;
bool changed = FALSE;
items = menu_items(m);
i = current_item(m);
if (i == items[0]) {
if (item_value(i)) {
+ ITEM **p;
for (p = items + 1; *p != 0; p++)
if (item_value(*p)) {
set_item_value(*p, FALSE);
@@ -593,7 +610,6 @@ perform_trace_menu(int cmd)
/* interactively set the trace level */
{
ITEM **ip;
- unsigned newtrace;
int result;
for (ip = menu_items(mpTrace); *ip; ip++) {
@@ -609,14 +625,14 @@ perform_trace_menu(int cmd)
if (result == E_OK) {
if (update_trace_menu(mpTrace) || cmd == REQ_TOGGLE_ITEM) {
- newtrace = 0;
+ unsigned newtrace = 0;
for (ip = menu_items(mpTrace); *ip; ip++) {
if (item_value(*ip)) {
MENU_DATA *td = (MENU_DATA *) item_userptr(*ip);
newtrace |= td->mask;
}
}
- trace(newtrace);
+ curses_trace(newtrace);
Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
MvWPrintw(status, 1, 0,
@@ -751,6 +767,36 @@ move_menus(MENU * current, int by_y, int by_x)
}
}
+#if defined(KEY_RESIZE) && NCURSES_EXT_FUNCS
+static void
+resize_menu(MENU ** menu)
+{
+#if 0
+ WINDOW *win = menu_win(*menu);
+ WINDOW *sub = menu_sub(*menu);
+#endif
+ (void) menu;
+}
+
+static void
+resize_menus(MENU * current)
+{
+ (void) current;
+
+ werase(status);
+ wnoutrefresh(status);
+ wresize(status, 1, COLS);
+ mvwin(status, LINES - 1, 0);
+
+ resize_menu(&mpBanner);
+ resize_menu(&mpFile);
+ resize_menu(&mpSelect);
+#ifdef TRACE
+ resize_menu(&mpTrace);
+#endif
+}
+#endif /* defined(KEY_RESIZE) && NCURSES_EXT_FUNCS */
+
static void
show_status(int ch, MENU * menu)
{
@@ -774,7 +820,7 @@ perform_menus(void)
int ch = ERR;
#ifdef NCURSES_MOUSE_VERSION
- mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
+ mousemask(BUTTON1_CLICKED, (mmask_t *) 0);
#endif
menu_display(last_menu);
@@ -803,6 +849,11 @@ perform_menus(void)
case KEY_SRIGHT:
move_menus(last_menu, 0, 1);
continue;
+#if defined(KEY_RESIZE) && NCURSES_EXT_FUNCS
+ case KEY_RESIZE:
+ resize_menus(last_menu);
+ continue;
+#endif
}
cmd = menu_virtualize(ch);
@@ -836,9 +887,17 @@ perform_menus(void)
#endif
}
+#if defined(NCURSES_MOUSE_VERSION) && defined(O_MOUSE_MENU)
if ((code == E_REQUEST_DENIED) && (cmd == KEY_MOUSE)) {
+ (void) menu_getc(mpBanner);
code = menu_driver(mpBanner, cmd);
+ if (code == E_REQUEST_DENIED) {
+ MEVENT event;
+ if (menu_getc(mpBanner) == KEY_MOUSE)
+ getmouse(&event); /* give up */
+ }
}
+#endif
break;
}
@@ -868,10 +927,6 @@ perform_menus(void)
beep();
continue;
}
-
-#ifdef NCURSES_MOUSE_VERSION
- mousemask(0, (mmask_t *) 0);
-#endif
}
static void
@@ -950,7 +1005,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) {
+ while ((c = getopt(argc, argv, "fht:")) != -1) {
switch (c) {
#if HAVE_RIPOFFLINE
case 'f':
@@ -962,7 +1017,7 @@ main(int argc, char *argv[])
#endif /* HAVE_RIPOFFLINE */
#ifdef TRACE
case 't':
- trace((unsigned) strtoul(optarg, 0, 0));
+ curses_trace((unsigned) strtoul(optarg, 0, 0));
break;
#endif
default:
diff --git a/test/demo_new_pair.c b/test/demo_new_pair.c
new file mode 100644
index 0000000..bd62a08
--- /dev/null
+++ b/test/demo_new_pair.c
@@ -0,0 +1,356 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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: demo_new_pair.c,v 1.21 2020/02/02 23:34:34 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
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define MAX_BITS 8 /* all but A_ALTCHARSET */
+#define MAX_ATTR ((1<<MAX_BITS)-1)
+
+static bool
+valid_cap(NCURSES_CONST char *name)
+{
+ char *value = tigetstr(name);
+ return (value != 0 && value != (char *) -1) ? TRUE : FALSE;
+}
+
+static attr_t
+next_attr(int now)
+{
+ static bool init = FALSE;
+ static attr_t table[MAX_BITS * MAX_BITS];
+ static int limit = 0;
+
+ if (!init) {
+ int j, k;
+ attr_t bits[MAX_BITS];
+
+ init = TRUE;
+ bits[limit++] = WA_NORMAL;
+ if (valid_cap("smso"))
+ bits[limit++] = WA_STANDOUT;
+ if (valid_cap("smul"))
+ bits[limit++] = WA_UNDERLINE;
+ if (valid_cap("rev"))
+ bits[limit++] = WA_REVERSE;
+ if (valid_cap("blink"))
+ bits[limit++] = WA_BLINK;
+ if (valid_cap("dim"))
+ bits[limit++] = WA_DIM;
+ if (valid_cap("bold"))
+ bits[limit++] = WA_BOLD;
+ for (j = 0; j < limit; ++j) {
+ for (k = 0; k < limit; ++k) {
+ table[j * limit + k] = bits[j] | bits[k];
+ }
+ }
+ }
+ return table[now % limit];
+}
+
+static void
+our_content(int pair, int *fg, int *bg)
+{
+ pair %= COLOR_PAIRS;
+ *fg = (pair / COLORS) % COLORS;
+ *bg = (pair % COLORS);
+}
+
+static int
+make_color(int now)
+{
+ int fg, bg;
+ our_content(now, &fg, &bg);
+ return alloc_pair(fg, bg);
+}
+
+static int
+next_color(int now)
+{
+ int result = 0;
+ if ((short) now > 0) {
+ if (now < COLOR_PAIRS) {
+ int fg, bg;
+ our_content(now, &fg, &bg);
+ if (init_pair((short) now, (short) fg, (short) bg) != OK)
+ now = ERR;
+ } else {
+ now %= COLOR_PAIRS;
+ }
+ result = now;
+ }
+ return result;
+}
+
+static time_t
+now(void)
+{
+ return time((time_t *) 0);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: demo_new_pair [options]",
+ "",
+ "Repeatedly print using all possible color combinations.",
+ "",
+ "Options:",
+ " -i use init_pair rather than alloc_pair",
+ " -p start in paged-mode",
+ " -s start in single-step mode",
+ " -w print a wide-character cell",
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+#define use_pages() \
+ paged_mode = TRUE, single_mode = TRUE
+
+#define use_single() \
+ paged_mode = FALSE, single_mode = TRUE
+
+#define update_modes() \
+ scrollok(stdscr, !paged_mode); \
+ nodelay(stdscr, !single_mode || paged_mode)
+
+int
+main(int argc, char *argv[])
+{
+ static const char *help[] =
+ {
+ "This program iterates over the possible color combinations,",
+ "allocating or initializing color pairs. For best results,",
+ "choose screen-width dividing evenly into the number of colors,",
+ "e.g.,",
+ "",
+ " 32x64,32x128 256 colors",
+ " 24x44,24x88 88 colors",
+ " 32x64,24x128 16 colors",
+ "",
+ "Keys:",
+ " c toggle between coloring and de-coloring cells",
+ " p show one page at a time",
+ " s show one character at a time",
+ " <space> display char/page without pausing",
+ " v/V cycle through video attributes",
+ " w toggle between \"#\" and a double-width equivalent",
+ " ? print this screen (exit on any character).",
+ "",
+ "To exit this program, press ^Q, ^[ or \"q\".",
+ 0
+ };
+
+ bool done = FALSE;
+ bool clobber = FALSE;
+ bool hascolor = FALSE;
+ bool use_init = FALSE;
+ bool use_wide = FALSE;
+ bool paged_mode = FALSE;
+ bool single_mode = FALSE;
+ int video_mode = 0;
+ int current;
+ int ch;
+ wchar_t wch[2];
+ time_t start = now();
+ long total_cells = 0;
+ FILE *output = 0;
+
+ setlocale(LC_ALL, "");
+
+ while ((ch = getopt(argc, argv, "ipsw")) != -1) {
+ switch (ch) {
+ case 'i':
+ use_init = TRUE;
+ break;
+ case 'p':
+ use_pages();
+ break;
+ case 's':
+ use_single();
+ break;
+ case 'w':
+ use_wide = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+
+ if (isatty(fileno(stderr))) {
+ output = stderr;
+ } else if ((ch = open("/dev/tty", O_WRONLY)) >= 0) {
+ output = fdopen(ch, "w");
+ } else {
+ fprintf(stderr, "cannot open terminal for output\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+ if (newterm(NULL, output, stdin) == 0) {
+ fprintf(stderr, "Cannot initialize terminal\n");
+ fclose(output);
+ ExitProgram(EXIT_FAILURE);
+ }
+ (void) cbreak(); /* read chars without wait for \n */
+ (void) noecho(); /* don't echo input */
+ update_modes();
+ curs_set(0);
+
+ keypad(stdscr, TRUE);
+
+ if ((hascolor = has_colors())) {
+ start_color();
+ current = 1;
+ } else {
+ current = 0;
+ }
+
+ /*
+ * Repeatedly cycle through all colors, initializing pairs as needed.
+ * Provide for single-stepping, or page-at-a-time, as well as quitting.
+ */
+ while (!done) {
+ cchar_t temp;
+ attr_t my_attrs;
+ int my_pair;
+
+ switch (getch()) {
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
+ case 'p':
+ /* step-by-page */
+ use_pages();
+ update_modes();
+ break;
+ case 's':
+ /* step-by-char */
+ use_single();
+ update_modes();
+ break;
+ case ' ':
+ single_mode = FALSE;
+ update_modes();
+ break;
+ case QUIT:
+ case ESCAPE:
+ case 'q':
+ done = TRUE;
+ continue;
+ case 'c':
+ clobber = !clobber;
+ continue;
+ case 'v':
+ if (--video_mode < 0)
+ video_mode = MAX_ATTR;
+ continue;
+ case 'V':
+ if (video_mode > MAX_ATTR)
+ video_mode = 0;
+ continue;
+ case 'w':
+ use_wide = !use_wide;
+ continue;
+ case ERR:
+ break;
+ default:
+ beep();
+ break;
+ }
+ if (hascolor) {
+ my_attrs = next_attr(video_mode);
+ if (clobber) {
+ int fg, bg;
+ our_content(current, &fg, &bg);
+ my_pair = find_pair(fg, bg);
+ if (my_pair > 0) {
+ free_pair(my_pair);
+ }
+ my_pair = 0;
+ } else {
+ my_pair = (use_init
+ ? next_color(current)
+ : make_color(current));
+ }
+ } else {
+ my_attrs = next_attr(current);
+ my_pair = 0;
+ }
+ if (my_pair < 0)
+ break;
+ wch[0] = use_wide ? 0xff03 : '#';
+ wch[1] = 0;
+ setcchar(&temp, wch, my_attrs,
+ (short) my_pair,
+ (use_init ? NULL : (void *) &my_pair));
+ /*
+ * At the end of a page, move the cursor to the home position.
+ */
+ if ((add_wch(&temp) == ERR) && paged_mode) {
+ nodelay(stdscr, !single_mode);
+ move(0, 0);
+ }
+ total_cells += 1 + (use_wide ? 1 : 0);
+ ++current;
+ }
+ stop_curses();
+ fclose(output);
+
+ printf("%.1f cells/second\n",
+ (double) (total_cells) / (double) (now() - start));
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the ncurses alloc_pair function\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/demo_panels.c b/test/demo_panels.c
index 041b5bb..005483e 100644
--- a/test/demo_panels.c
+++ b/test/demo_panels.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2010,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: demo_panels.c,v 1.38 2014/08/02 17:24:07 tom Exp $
+ * $Id: demo_panels.c,v 1.45 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate a variety of functions from the panel library.
*/
@@ -204,7 +205,7 @@ mkpanel(short color, int rows, int cols, int tly, int tlx)
{
WINDOW *win;
PANEL *pan = 0;
- char *userdata = typeMalloc(char, 3);
+ char *userdata = typeMalloc(char, 6);
if ((win = newwin(rows, cols, tly, tlx)) != 0) {
keypad(win, TRUE);
@@ -222,13 +223,13 @@ mkpanel(short color, int rows, int cols, int tly, int tlx)
wbkgdset(win, A_BOLD | ' ');
}
}
- sprintf(userdata, "p%d", color % 8);
+ _nc_SPRINTF(userdata, _nc_SLIMIT(4) "p%d", color % 8);
set_panel_userptr(pan, (NCURSES_CONST void *) userdata);
return pan;
}
static void
-my_remove_panel(PANEL ** pans, int which)
+my_remove_panel(PANEL **pans, int which)
{
if (pans[which] != 0) {
PANEL *pan = pans[which];
@@ -248,9 +249,8 @@ my_remove_panel(PANEL ** pans, int which)
#define ABS(a) ((a) < 0 ? -(a) : (a))
static void
-my_create_panel(PANEL ** pans, int which, FillPanel myFill)
+my_create_panel(PANEL **pans, int which, FillPanel myFill)
{
- PANEL *pan = 0;
int code;
short pair = (short) which;
short fg = (short) ((pair == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK);
@@ -271,7 +271,7 @@ my_create_panel(PANEL ** pans, int which, FillPanel myFill)
if (code > 0) {
char also[80];
- sprintf(also, " (first %d,%d)", y0, x0);
+ _nc_SPRINTF(also, _nc_SLIMIT(sizeof(also)) " (first %d,%d)", y0, x0);
/* get the position of the opposite corner */
while ((code = get_position("Opposite corner",
also, which, &x1, &y1)) == 0) {
@@ -281,7 +281,10 @@ my_create_panel(PANEL ** pans, int which, FillPanel myFill)
if (code > 0) {
int tly = MIN(y0, y1);
int tlx = MIN(x0, x1);
- pan = mkpanel(pair, ABS(y1 - y0) + 1, ABS(x1 - x0) + 1, tly, tlx);
+ PANEL *pan = mkpanel(pair,
+ ABS(y1 - y0) + 1,
+ ABS(x1 - x0) + 1,
+ tly, tlx);
/* finish */
myFill(pan);
pans[which] = pan;
@@ -292,7 +295,7 @@ my_create_panel(PANEL ** pans, int which, FillPanel myFill)
}
static void
-my_move_panel(PANEL ** pans, int which, bool continuous)
+my_move_panel(PANEL **pans, int which, bool continuous)
{
if (pans[which] != 0) {
int code;
@@ -302,7 +305,7 @@ my_move_panel(PANEL ** pans, int which, bool continuous)
char also[80];
getbegyx(win, y0, x0);
- sprintf(also, " (start %d,%d)", y0, x0);
+ _nc_SPRINTF(also, _nc_SLIMIT(sizeof(also)) " (start %d,%d)", y0, x0);
wmove(stdscr, y0, x0);
while ((code = get_position("Move panel", also, which, &x1, &y1)) == 0) {
if (continuous) {
@@ -317,7 +320,7 @@ my_move_panel(PANEL ** pans, int which, bool continuous)
}
static void
-my_resize_panel(PANEL ** pans, int which, FillPanel myFill)
+my_resize_panel(PANEL **pans, int which, FillPanel myFill)
{
if (pans[which] != 0) {
int code;
@@ -327,7 +330,7 @@ my_resize_panel(PANEL ** pans, int which, FillPanel myFill)
char also[80];
getbegyx(win, y0, x0);
- sprintf(also, " (start %d,%d)", y0, x0);
+ _nc_SPRINTF(also, _nc_SLIMIT(sizeof(also)) " (start %d,%d)", y0, x0);
wmove(stdscr, y0, x0);
while ((code = get_position("Resize panel",
also, which, &x1, &y1)) == 0) {
@@ -365,7 +368,7 @@ init_panel(void)
}
static void
-fill_panel(PANEL * pan)
+fill_panel(PANEL *pan)
{
WINDOW *win = panel_window(pan);
const char *userptr = (const char *) panel_userptr(pan);
@@ -385,7 +388,7 @@ fill_panel(PANEL * pan)
}
static void
-fill_unboxed(PANEL * pan)
+fill_unboxed(PANEL *pan)
{
WINDOW *win = panel_window(pan);
const char *userptr = (const char *) panel_userptr(pan);
@@ -428,7 +431,7 @@ init_wide_panel(void)
}
static void
-fill_wide_panel(PANEL * pan)
+fill_wide_panel(PANEL *pan)
{
WINDOW *win = panel_window(pan);
int num = ((const char *) panel_userptr(pan))[1];
@@ -450,7 +453,7 @@ fill_wide_panel(PANEL * pan)
#define MAX_PANELS 5
static int
-which_panel(PANEL * px[MAX_PANELS + 1], PANEL * pan)
+which_panel(PANEL *px[MAX_PANELS + 1], PANEL *pan)
{
int result = 0;
int j;
@@ -465,7 +468,7 @@ which_panel(PANEL * px[MAX_PANELS + 1], PANEL * pan)
}
static void
-show_panels(PANEL * px[MAX_PANELS + 1])
+show_help(WINDOW *win)
{
static const char *help[] =
{
@@ -479,9 +482,19 @@ 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"
};
+ int j;
+
+ for (j = 0; j < (int) SIZEOF(help); ++j) {
+ if (wprintw(win, "%s\n", help[j]) == ERR)
+ break;
+ }
+}
+static void
+show_panels(PANEL *px[MAX_PANELS + 1])
+{
struct {
bool valid;
bool hidden;
@@ -490,7 +503,6 @@ show_panels(PANEL * px[MAX_PANELS + 1])
} table[MAX_PANELS + 1];
WINDOW *win;
- PANEL *pan;
int j;
memset(table, 0, sizeof(table));
@@ -504,6 +516,8 @@ show_panels(PANEL * px[MAX_PANELS + 1])
}
if ((win = newwin(LINES - 1, COLS, 0, 0)) != 0) {
+ PANEL *pan;
+
keypad(win, TRUE);
if ((pan = new_panel(win)) != 0) {
werase(win);
@@ -527,10 +541,7 @@ show_panels(PANEL * px[MAX_PANELS + 1])
waddch(win, '\n');
}
}
- for (j = 0; j < (int) SIZEOF(help); ++j) {
- if (wprintw(win, "%s\n", help[j]) == ERR)
- break;
- }
+ show_help(win);
wgetch(win);
del_panel(pan);
pflush();
@@ -556,7 +567,7 @@ wrapper(top_panel)
/* *INDENT-ON* */
static void
-do_panel(PANEL * px[MAX_PANELS + 1],
+do_panel(PANEL *px[MAX_PANELS + 1],
NCURSES_CONST char *cmd,
FillPanel myFill)
{
@@ -622,11 +633,10 @@ ok_digit(int ch)
* End the command with a newline. Reject other characters.
*/
static bool
-get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit)
+get_command(PANEL *px[MAX_PANELS + 1], char *buffer, int limit)
{
int length = 0;
int y0, x0;
- int c0, ch;
WINDOW *win;
getyx(stdscr, y0, x0);
@@ -645,9 +655,9 @@ get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit)
}
(void) wgetch(win);
} else {
- c0 = 0;
+ int c0 = 0;
for (;;) {
- ch = wgetch(win);
+ int ch = wgetch(win);
if (ch == ERR || ch == QUIT || ch == ESCAPE) {
buffer[0] = '\0';
break;
@@ -655,7 +665,7 @@ get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit)
wrefresh(curscr);
} else if (ch == '\n' || ch == KEY_ENTER) {
break;
- } else if (ch == '?') {
+ } else if (ch == HELP_KEY_1) {
show_panels(px);
} else if (length + 3 < limit) {
if (ch >= KEY_MIN) {
diff --git a/test/demo_tabs.c b/test/demo_tabs.c
new file mode 100644
index 0000000..f63850d
--- /dev/null
+++ b/test/demo_tabs.c
@@ -0,0 +1,119 @@
+/****************************************************************************
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: demo_tabs.c,v 1.5 2020/02/02 23:34:34 tom Exp $
+ *
+ * A simple demo of tabs in curses.
+ */
+#define USE_TINFO
+#include "test.priv.h"
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: demo_tabs [options]",
+ "",
+ "Print a grid to test tab-stops with the curses interface",
+ "",
+ "Options:",
+ " -l COUNT total number of lines to show",
+ " -t NUM set TABSIZE variable to the given value",
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int tabstop;
+ int n, col, row, step;
+ int line_limit = -1;
+ int curses_stops = -1;
+
+ while ((n = getopt(argc, argv, "l:t:")) != -1) {
+ switch (n) {
+ case 'l':
+ line_limit = atoi(optarg);
+ break;
+ case 't':
+ curses_stops = atoi(optarg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+
+ initscr();
+ noecho();
+ cbreak();
+ if (curses_stops > 0)
+ set_tabsize(curses_stops);
+#if HAVE_TIGETNUM
+ tabstop = tigetnum("it");
+ if (tabstop <= 0)
+#endif
+ tabstop = 8;
+ for (row = 0; row < LINES; ++row) {
+ move(row, 0);
+ for (col = step = 0; col < COLS - 1; ++col) {
+ if (row == 0) {
+ chtype ch = '-';
+ if ((col % tabstop) == 0)
+ ch = '+';
+ addch(ch);
+ } else if (col + 1 < row) {
+ addch('*');
+ } else {
+ printw("%x", step);
+ col = (row + (tabstop * ++step));
+ col /= tabstop;
+ col *= tabstop;
+ col -= 1;
+ if ((col + tabstop) < COLS)
+ addch('\t');
+ refresh();
+ }
+ }
+ addch('\n');
+ if (line_limit > 0 && row >= line_limit)
+ break;
+ }
+ getch();
+ endwin();
+ ExitProgram(EXIT_SUCCESS);
+}
diff --git a/test/demo_termcap.c b/test/demo_termcap.c
index 2a29266..adc9eee 100644
--- a/test/demo_termcap.c
+++ b/test/demo_termcap.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2005-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2005-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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.46 2014/10/10 00:35:43 tom Exp $
+ * $Id: demo_termcap.c,v 1.59 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the termcap interface.
*/
@@ -46,6 +47,16 @@
#endif
#endif
+#if defined(NCURSES_VERSION)
+#if HAVE_NCURSES_TERMCAP_H
+#include <ncurses/termcap.h>
+#elif HAVE_TERMCAP_H
+#include <termcap.h>
+#endif
+#endif
+
+static void failed(const char *) GCC_NORETURN;
+
static void
failed(const char *msg)
{
@@ -68,8 +79,10 @@ static bool b_opt = FALSE;
static bool n_opt = FALSE;
static bool s_opt = FALSE;
static bool q_opt = FALSE;
+#ifdef NCURSES_VERSION
static bool x_opt = FALSE;
static bool y_opt = FALSE;
+#endif
static char *d_opt;
static char *e_opt;
@@ -94,8 +107,9 @@ static long total_s_values;
static char *
make_dbitem(char *p, char *q)
{
- char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
- sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
+ size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
+ char *result = malloc(need);
+ _nc_SPRINTF(result, _nc_SLIMIT(need) "%s=%.*s", e_opt, (int) (p - q), q);
return result;
}
@@ -146,10 +160,12 @@ next_dbitem(void)
db_item++;
}
}
- printf("** %s\n", result);
+ if (result != 0)
+ printf("** %s\n", result);
return result;
}
+#if NO_LEAKS
static void
free_dblist(void)
{
@@ -161,6 +177,73 @@ free_dblist(void)
db_list = 0;
}
}
+#endif /* NO_LEAKS */
+
+static void
+show_string(const char *name, const char *value)
+{
+ printf(FNAME(str), name);
+ if (value == ((char *) -1)) {
+ printf("CANCELLED");
+ } else if (value == ((char *) 0)) {
+ printf("ABSENT");
+ } else {
+ while (*value != 0) {
+ int ch = UChar(*value++);
+ switch (ch) {
+ case '\177':
+ fputs("^?", stdout);
+ break;
+ case '\033':
+ fputs("\\E", stdout);
+ break;
+ case '\b':
+ fputs("\\b", stdout);
+ break;
+ case '\f':
+ fputs("\\f", stdout);
+ break;
+ case '\n':
+ fputs("\\n", stdout);
+ break;
+ case '\r':
+ fputs("\\r", stdout);
+ break;
+ case ' ':
+ fputs("\\s", stdout);
+ break;
+ case '\t':
+ fputs("\\t", stdout);
+ break;
+ case '^':
+ fputs("\\^", stdout);
+ break;
+ case ':':
+ fputs("\\072", stdout);
+ break;
+ case '\\':
+ fputs("\\\\", stdout);
+ break;
+ default:
+ if (isgraph(ch))
+ fputc(ch, stdout);
+ else if (ch < 32)
+ printf("^%c", ch + '@');
+ else
+ printf("\\%03o", ch);
+ break;
+ }
+ }
+ }
+ printf("\n");
+}
+
+static void
+show_number(const char *name, int value)
+{
+ printf(FNAME(num), name);
+ printf(" %d\n", value);
+}
static void
dumpit(NCURSES_CONST char *cap)
@@ -184,61 +267,13 @@ dumpit(NCURSES_CONST char *cap)
* Note that the strings returned are mostly terminfo format, since
* ncurses does not convert except for a handful of special cases.
*/
- printf(FNAME(str), cap);
- while (*str != 0) {
- int ch = UChar(*str++);
- switch (ch) {
- case '\177':
- fputs("^?", stdout);
- break;
- case '\033':
- fputs("\\E", stdout);
- break;
- case '\b':
- fputs("\\b", stdout);
- break;
- case '\f':
- fputs("\\f", stdout);
- break;
- case '\n':
- fputs("\\n", stdout);
- break;
- case '\r':
- fputs("\\r", stdout);
- break;
- case ' ':
- fputs("\\s", stdout);
- break;
- case '\t':
- fputs("\\t", stdout);
- break;
- case '^':
- fputs("\\^", stdout);
- break;
- case ':':
- fputs("\\072", stdout);
- break;
- case '\\':
- fputs("\\\\", stdout);
- break;
- default:
- if (isgraph(ch))
- fputc(ch, stdout);
- else if (ch < 32)
- printf("^%c", ch + '@');
- else
- printf("\\%03o", ch);
- break;
- }
- }
- printf("\n");
+ show_string(cap, str);
}
} else if ((num = tgetnum(cap)) >= 0) {
total_values++;
total_n_values++;
if (!q_opt) {
- printf(FNAME(num), cap);
- printf(" %d\n", num);
+ show_number(cap, num);
}
} else if (tgetflag(cap) > 0) {
total_values++;
@@ -294,8 +329,6 @@ dump_xname(NCURSES_CONST char *cap)
static void
demo_termcap(NCURSES_CONST char *name)
{
- unsigned n;
- NCURSES_CONST char *cap;
char buffer[1024];
if (db_list) {
@@ -304,6 +337,8 @@ demo_termcap(NCURSES_CONST char *name)
if (!q_opt)
printf("Terminal type \"%s\"\n", name);
if (tgetent(buffer, name) >= 0) {
+ NCURSES_CONST char *cap;
+ unsigned n;
if (b_opt) {
for (n = 0;; ++n) {
@@ -334,7 +369,7 @@ demo_termcap(NCURSES_CONST char *name)
#ifdef NCURSES_VERSION
if (x_opt && (my_blob == 0) && y_opt) {
#if NCURSES_XNAMES
- TERMTYPE *term = &(cur_term->type);
+ TERMTYPE *term = (TERMTYPE *) cur_term;
if (term != 0
&& ((NUM_BOOLEANS(term) != BOOLCOUNT)
|| (NUM_NUMBERS(term) != NUMCOUNT)
@@ -665,7 +700,6 @@ copy_code_list(NCURSES_CONST char *const *list)
size_t count;
size_t length = 1;
char **result = 0;
- char *blob = 0;
char *unused = 0;
for (pass = 0; pass < 2; ++pass) {
@@ -675,12 +709,12 @@ copy_code_list(NCURSES_CONST char *const *list)
length += chunk;
} else {
result[count] = unused;
- strcpy(unused, list[count]);
+ _nc_STRCPY(unused, list[count], length);
unused += chunk;
}
}
if (pass == 0) {
- blob = malloc(length);
+ char *blob = malloc(length);
result = typeCalloc(char *, count + 1);
unused = blob;
if (blob == 0 || result == 0)
@@ -690,7 +724,18 @@ copy_code_list(NCURSES_CONST char *const *list)
return result;
}
-#endif
+
+#if NO_LEAKS
+static void
+free_code_list(char **list)
+{
+ if (list) {
+ free(list[0]);
+ free(list);
+ }
+}
+#endif /* NO_LEAKS */
+#endif /* USE_CODE_LISTS */
static void
usage(void)
@@ -712,6 +757,7 @@ usage(void)
" -q quiet (prints only counts)",
" -r COUNT repeat for given count",
" -s print string-capabilities",
+ " -v print termcap-variables",
#ifdef NCURSES_VERSION
" -x print extended capabilities",
#endif
@@ -729,12 +775,15 @@ main(int argc, char *argv[])
int n;
char *name;
bool a_opt = FALSE;
+#if defined(NCURSES_VERSION) || defined(HAVE_CURSES_DATA_OSPEED)
+ bool v_opt = FALSE;
+#endif
char *input_name = 0;
int repeat;
int r_opt = 1;
- while ((n = getopt(argc, argv, "abd:e:i:nqr:sxy")) != -1) {
+ while ((n = getopt(argc, argv, "abd:e:i:nqr:svxy")) != -1) {
switch (n) {
case 'a':
a_opt = TRUE;
@@ -764,6 +813,12 @@ main(int argc, char *argv[])
case 's':
s_opt = TRUE;
break;
+#if defined(NCURSES_VERSION) || defined(HAVE_CURSES_DATA_OSPEED)
+ case 'v':
+ v_opt = TRUE;
+ break;
+#endif
+#ifdef NCURSES_VERSION
#if NCURSES_XNAMES
case 'x':
x_opt = TRUE;
@@ -773,6 +828,7 @@ main(int argc, char *argv[])
x_opt = TRUE;
break;
#endif
+#endif
default:
usage();
break;
@@ -836,7 +892,23 @@ main(int argc, char *argv[])
printf("%ld values (%ld booleans, %ld numbers, %ld strings)\n",
total_values, total_b_values, total_n_values, total_s_values);
+#if defined(NCURSES_VERSION) || defined(HAVE_CURSES_DATA_OSPEED)
+ if (v_opt) {
+ show_number("PC", PC);
+ show_string("UP", UP);
+ show_string("BC", BC);
+ show_number("ospeed", (int) ospeed);
+ }
+#endif
+
+#if NO_LEAKS
free_dblist();
+#if USE_CODE_LISTS
+ free_code_list(my_boolcodes);
+ free_code_list(my_numcodes);
+ free_code_list(my_strcodes);
+#endif
+#endif /* NO_LEAKS */
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c
index 3b44a0b..8ea0edf 100644
--- a/test/demo_terminfo.c
+++ b/test/demo_terminfo.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2009-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_terminfo.c,v 1.38 2014/10/10 00:35:28 tom Exp $
+ * $Id: demo_terminfo.c,v 1.50 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the terminfo interface.
*/
@@ -46,6 +47,8 @@
#endif
#endif
+static void failed(const char *) GCC_NORETURN;
+
static void
failed(const char *msg)
{
@@ -67,8 +70,10 @@ static bool f_opt = FALSE;
static bool n_opt = FALSE;
static bool q_opt = FALSE;
static bool s_opt = FALSE;
+#ifdef NCURSES_VERSION
static bool x_opt = FALSE;
static bool y_opt = FALSE;
+#endif
static char *d_opt;
static char *e_opt;
@@ -88,13 +93,14 @@ static long total_n_values;
static long total_s_values;
#define FCOLS 8
-#define FNAME(type) "%s %-*s = ", #type, FCOLS
+#define FNAME(type) "%s %-*s = ", #type, f_opt ? 24 : FCOLS
static char *
make_dbitem(char *p, char *q)
{
- char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
- sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
+ size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
+ char *result = malloc(need);
+ _nc_SPRINTF(result, _nc_SLIMIT(need) "%s=%.*s", e_opt, (int) (p - q), q);
return result;
}
@@ -145,11 +151,12 @@ next_dbitem(void)
db_item++;
}
}
- printf("** %s\n", result);
+ if (result != 0)
+ printf("** %s\n", result);
return result;
}
-#ifdef NO_LEAKS
+#if NO_LEAKS
static void
free_dblist(void)
{
@@ -164,7 +171,7 @@ free_dblist(void)
#endif
static void
-dumpit(NCURSES_CONST char *cap)
+dumpit(NCURSES_CONST char *cap, const char *show)
{
const char *str;
int num;
@@ -173,7 +180,7 @@ dumpit(NCURSES_CONST char *cap)
total_values++;
total_s_values++;
if (!q_opt) {
- printf(FNAME(str), cap);
+ printf(FNAME(str), show ? show : cap);
while (*str != 0) {
int ch = UChar(*str++);
switch (ch) {
@@ -226,14 +233,14 @@ dumpit(NCURSES_CONST char *cap)
total_values++;
total_n_values++;
if (!q_opt) {
- printf(FNAME(num), cap);
+ printf(FNAME(num), show ? show : cap);
printf(" %d\n", num);
}
} else if ((num = tigetflag(cap)) >= 0) {
total_values++;
total_b_values++;
if (!q_opt) {
- printf(FNAME(flg), cap);
+ printf(FNAME(flg), show ? show : cap);
printf("%s\n", num ? "true" : "false");
}
}
@@ -266,6 +273,10 @@ abcdefghijklmnopqrstuvwxyz_";
if (!q_opt)
printf("Terminal type \"%s\"\n", name);
setupterm((NCURSES_CONST char *) name, 1, (int *) 0);
+ if (!q_opt) {
+ if (strcmp(name, ttytype))
+ printf("... actual \"%s\"\n", ttytype);
+ }
for (length = 1; length <= MAX_FORCE; ++length) {
/* set all digits to zeros */
@@ -280,7 +291,7 @@ abcdefghijklmnopqrstuvwxyz_";
cap[j] = legal[item[j]];
}
cap[length] = '\0';
- dumpit(cap);
+ dumpit(cap, NULL);
k = length - 1;
do {
@@ -307,9 +318,9 @@ abcdefghijklmnopqrstuvwxyz_";
}
#if USE_CODE_LISTS
-#define fullname(type,n) f_opt ? type##fnames[n] : my_##type##codes[n]
+#define fullname(type,n) f_opt ? type##fnames[n] : cap
#else
-#define fullname(type,n) my_##type##codes[n]
+#define fullname(type,n) cap
#endif
static void
@@ -327,48 +338,47 @@ demo_terminfo(char *name)
if (b_opt) {
for (n = 0;; ++n) {
- cap = fullname(bool, n);
+ cap = my_boolcodes[n];
if (cap == 0)
break;
- dumpit(cap);
+ dumpit(cap, fullname(bool, n));
}
}
if (n_opt) {
for (n = 0;; ++n) {
- cap = fullname(num, n);
+ cap = my_numcodes[n];
if (cap == 0)
break;
- dumpit(cap);
+ dumpit(cap, fullname(num, n));
}
}
if (s_opt) {
for (n = 0;; ++n) {
- cap = fullname(str, n);
+ cap = my_strcodes[n];
if (cap == 0)
break;
- dumpit(cap);
+ dumpit(cap, fullname(str, n));
}
}
#ifdef NCURSES_VERSION
if (x_opt && (my_blob == 0)) {
- int mod;
if (y_opt) {
#if NCURSES_XNAMES
- TERMTYPE *term = &(cur_term->type);
+ TERMTYPE *term = (TERMTYPE *) cur_term;
if (term != 0
&& ((NUM_BOOLEANS(term) != BOOLCOUNT)
|| (NUM_NUMBERS(term) != NUMCOUNT)
|| (NUM_STRINGS(term) != STRCOUNT))) {
for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) {
- dumpit(ExtBoolname(term, (int) n, boolnames));
+ dumpit(ExtBoolname(term, (int) n, boolnames), NULL);
}
for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) {
- dumpit(ExtNumname(term, (int) n, numnames));
+ dumpit(ExtNumname(term, (int) n, numnames), NULL);
}
for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) {
- dumpit(ExtStrname(term, (int) n, strnames));
+ dumpit(ExtStrname(term, (int) n, strnames), NULL);
}
}
#endif
@@ -380,6 +390,7 @@ demo_terminfo(char *name)
"kLFT", "kNXT", "kPRV", "kRIT", "kUP",
};
for (n = 0; n < SIZEOF(xterm_keys); ++n) {
+ int mod;
for (mod = 0; mod < 8; ++mod) {
if (mod == 0) {
/* these happen to be standard - avoid duplicates */
@@ -390,11 +401,13 @@ demo_terminfo(char *name)
!strcmp(xterm_keys[n], "kRIT")) {
continue;
}
- sprintf(temp, "%.*s", 8, xterm_keys[n]);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "%.*s", 8, xterm_keys[n]);
} else {
- sprintf(temp, "%.*s%d", 8, xterm_keys[n], mod);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "%.*s%d", 8, xterm_keys[n], mod);
}
- dumpit(temp);
+ dumpit(temp, NULL);
}
}
}
@@ -717,7 +730,6 @@ copy_code_list(NCURSES_CONST char *const *list)
size_t count;
size_t length = 1;
char **result = 0;
- char *blob = 0;
char *unused = 0;
for (pass = 0; pass < 2; ++pass) {
@@ -727,12 +739,12 @@ copy_code_list(NCURSES_CONST char *const *list)
length += chunk;
} else {
result[count] = unused;
- strcpy(unused, list[count]);
+ _nc_STRCPY(unused, list[count], length);
unused += chunk;
}
}
if (pass == 0) {
- blob = malloc(length);
+ char *blob = malloc(length);
result = typeCalloc(char *, count + 1);
unused = blob;
if (blob == 0 || result == 0)
@@ -742,7 +754,18 @@ copy_code_list(NCURSES_CONST char *const *list)
return result;
}
+
+#if NO_LEAKS
+static void
+free_code_list(char **list)
+{
+ if (list) {
+ free(list[0]);
+ free(list);
+ }
+}
#endif
+#endif /* USE_CODE_LISTS */
static void
usage(void)
@@ -888,20 +911,33 @@ main(int argc, char *argv[])
}
}
- printf("%ld values (%ld booleans, %ld numbers, %ld strings)\n",
- total_values, total_b_values, total_n_values, total_s_values);
+#define PLURAL(n) n, (n != 1) ? "s" : ""
+ printf("%ld value%s (%ld boolean%s, %ld number%s, %ld string%s)\n",
+ PLURAL(total_values),
+ PLURAL(total_b_values),
+ PLURAL(total_n_values),
+ PLURAL(total_s_values));
-#ifdef NO_LEAKS
+#if NO_LEAKS
free_dblist();
- if (my_blob != 0) {
- free(my_blob);
- free(my_boolcodes);
- free(my_numcodes);
- free(my_numvalues);
- free(my_strcodes);
- free(my_strvalues);
+ if (input_name != 0) {
+ if (my_blob != 0) {
+ free(my_blob);
+ free(my_boolcodes);
+ free(my_numcodes);
+ free(my_numvalues);
+ free(my_strcodes);
+ free(my_strvalues);
+ }
+ }
+#if USE_CODE_LISTS
+ else {
+ free_code_list(my_boolcodes);
+ free_code_list(my_numcodes);
+ free_code_list(my_strcodes);
}
#endif
+#endif /* NO_LEAKS */
ExitProgram(EXIT_SUCCESS);
}
@@ -910,7 +946,7 @@ main(int argc, char *argv[])
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
- printf("This program requires the terminfo functions such as tigetstr\n");
+ failed("This program requires the terminfo functions such as tigetstr");
ExitProgram(EXIT_FAILURE);
}
#endif /* HAVE_TIGETSTR */
diff --git a/test/ditto.c b/test/ditto.c
index 921f216..a5cec33 100644
--- a/test/ditto.c
+++ b/test/ditto.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey (1998-on)
*
- * $Id: ditto.c,v 1.42 2012/11/24 20:16:18 tom Exp $
+ * $Id: ditto.c,v 1.49 2020/02/02 23:34:34 tom Exp $
*
* The program illustrates how to set up multiple screens from a single
* program.
@@ -44,6 +45,8 @@
#include <test.priv.h>
#include <sys/stat.h>
+#if HAVE_DELSCREEN
+
#ifdef USE_PTHREADS
#include <pthread.h>
#endif
@@ -112,7 +115,7 @@ failed(const char *s)
static void
usage(void)
{
- fprintf(stderr, "usage: ditto [terminal1 ...]\n");
+ fprintf(stderr, "Usage: ditto [terminal1 ...]\n");
ExitProgram(EXIT_FAILURE);
}
@@ -155,6 +158,10 @@ open_tty(char *path)
int aslave;
char slave_name[1024];
char s_option[sizeof(slave_name) + 80];
+ const char *xterm_prog = 0;
+
+ if ((xterm_prog = getenv("XTERM_PROG")) == 0)
+ xterm_prog = "xterm";
if (openpty(&amaster, &aslave, slave_name, 0, 0) != 0
|| strlen(slave_name) > sizeof(slave_name) - 1)
@@ -163,9 +170,10 @@ open_tty(char *path)
errno = EISDIR;
failed(slave_name);
}
- sprintf(s_option, "-S%s/%d", slave_name, aslave);
+ _nc_SPRINTF(s_option, _nc_SLIMIT(sizeof(s_option))
+ "-S%s/%d", slave_name, aslave);
if (fork()) {
- execlp("xterm", "xterm", s_option, "-title", path, (char *) 0);
+ execlp(xterm_prog, xterm_prog, s_option, "-title", path, (char *) 0);
_exit(0);
}
fp = fdopen(amaster, "r+");
@@ -189,7 +197,7 @@ open_tty(char *path)
return fp;
}
-static void
+static int
init_screen(
#if HAVE_USE_WINDOW
SCREEN *sp GCC_UNUSED,
@@ -229,6 +237,7 @@ init_screen(
target->windows[k] = inner;
}
doupdate();
+ return TRUE;
}
static void
@@ -445,3 +454,11 @@ main(int argc, char *argv[])
}
ExitProgram(EXIT_SUCCESS);
}
+#else
+int
+main(void)
+{
+ printf("This program requires the curses delscreen function\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/dots.c b/test/dots.c
index 474d880..d34473c 100644
--- a/test/dots.c
+++ b/test/dots.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1999-2011,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 1999-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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey <dickey@clark.net> 1999
*
- * $Id: dots.c,v 1.25 2013/09/28 22:12:09 tom Exp $
+ * $Id: dots.c,v 1.36 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the terminfo interface.
*/
@@ -40,8 +41,6 @@
#include <time.h>
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
@@ -64,7 +63,7 @@ TPUTS_PROTO(outc, c)
static bool
outs(const char *s)
{
- if (valid(s)) {
+ if (VALID_STRING(s)) {
tputs(s, 1, outc);
return TRUE;
}
@@ -80,7 +79,7 @@ cleanup(void)
outs(clear_screen);
outs(cursor_normal);
- printf("\n\n%ld total chars, rate %.2f/sec\n",
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
total_chars,
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
}
@@ -98,54 +97,125 @@ ranf(void)
return ((double) r / 32768.);
}
+static int
+get_number(NCURSES_CONST char *cap, int map)
+{
+ int result = map;
+ if (cap != 0) {
+ int check = tigetnum(cap);
+ if (check > 0)
+ result = check;
+ }
+ return result;
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: dots [options]"
+ ,""
+ ,"Options:"
+ ," -T TERM override $TERM"
+#if HAVE_USE_ENV
+ ," -e allow environment $LINES / $COLUMNS"
+#endif
+ ," -f use tigetnum rather than <term.h> mapping"
+ ," -m SIZE set margin (default: 2)"
+ ," -s MSECS delay 1% of the time (default: 1 msecs)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
+main(int argc,
+ char *argv[])
{
- int x, y, z, p;
+ int ch;
double r;
double c;
int my_colors;
+ int f_option = 0;
+ int m_option = 2;
+ int s_option = 1;
+ size_t need;
+ char *my_env;
+
+ while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) {
+ switch (ch) {
+ case 'T':
+ need = 6 + strlen(optarg);
+ my_env = malloc(need);
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ break;
+#if HAVE_USE_ENV
+ case 'e':
+ use_env(TRUE);
+ break;
+#endif
+ case 'f':
+ f_option = 1;
+ break;
+ case 'm':
+ m_option = atoi(optarg);
+ break;
+ case 's':
+ s_option = atoi(optarg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
- CATCHALL(onsig);
+ InitAndCatch(setupterm((char *) 0, 1, (int *) 0), onsig);
srand((unsigned) time(0));
- setupterm((char *) 0, 1, (int *) 0);
+
outs(clear_screen);
outs(cursor_invisible);
- my_colors = max_colors;
+
+#define GetNumber(ln,sn) get_number(f_option ? #sn : 0, ln)
+ my_colors = GetNumber(max_colors, colors);
if (my_colors > 1) {
- if (!valid(set_a_foreground)
- || !valid(set_a_background)
- || (!valid(orig_colors) && !valid(orig_pair)))
+ if (!VALID_STRING(set_a_foreground)
+ || !VALID_STRING(set_a_background)
+ || (!VALID_STRING(orig_colors) && !VALID_STRING(orig_pair)))
my_colors = -1;
}
- r = (double) (lines - 4);
- c = (double) (columns - 4);
+ r = (double) (GetNumber(lines, lines) - (m_option * 2));
+ c = (double) (GetNumber(columns, cols) - (m_option * 2));
started = time((time_t *) 0);
while (!interrupted) {
- x = (int) (c * ranf()) + 2;
- y = (int) (r * ranf()) + 2;
- p = (ranf() > 0.9) ? '*' : ' ';
+ int x = (int) (c * ranf()) + m_option;
+ int y = (int) (r * ranf()) + m_option;
+ int p = (ranf() > 0.9) ? '*' : ' ';
tputs(tparm3(cursor_address, y, x), 1, outc);
if (my_colors > 0) {
- z = (int) (ranf() * my_colors);
+ int z = (int) (ranf() * my_colors);
if (ranf() > 0.01) {
tputs(tparm2(set_a_foreground, z), 1, outc);
} else {
tputs(tparm2(set_a_background, z), 1, outc);
- napms(1);
+ napms(s_option);
}
- } else if (valid(exit_attribute_mode)
- && valid(enter_reverse_mode)) {
+ } else if (VALID_STRING(exit_attribute_mode)
+ && VALID_STRING(enter_reverse_mode)) {
if (ranf() <= 0.01) {
outs((ranf() > 0.6)
? enter_reverse_mode
: exit_attribute_mode);
- napms(1);
+ napms(s_option);
}
}
outc(p);
diff --git a/test/dots_curses.c b/test/dots_curses.c
index c344280..930f522 100644
--- a/test/dots_curses.c
+++ b/test/dots_curses.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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,20 +30,18 @@
/*
* 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.16 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the curses interface used for comparison with termcap.
*/
#include <test.priv.h>
-#if !defined(__MINGW32__)
+#if !defined(_WIN32)
#include <sys/time.h>
#endif
#include <time.h>
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
@@ -52,7 +51,7 @@ cleanup(void)
{
endwin();
- printf("\n\n%ld total chars, rate %.2f/sec\n",
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
total_chars,
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
}
@@ -86,51 +85,120 @@ set_colors(int fg, int bg)
}
}
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: dots_curses [options]"
+ ,""
+ ,"Options:"
+ ," -T TERM override $TERM"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors()"
+#endif
+#if HAVE_USE_ENV
+ ," -e allow environment $LINES / $COLUMNS"
+#endif
+ ," -m SIZE set margin (default: 2)"
+ ," -s MSECS delay 1% of the time (default: 1 msecs)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
- int x, y, z, p;
+ int ch;
int fg, bg;
double r;
double c;
-
- CATCHALL(onsig);
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
+ int m_option = 2;
+ int s_option = 1;
+ size_t need;
+ char *my_env;
+
+ while ((ch = getopt(argc, argv, "T:dem:s:")) != -1) {
+ switch (ch) {
+ case 'T':
+ need = 6 + strlen(optarg);
+ my_env = malloc(need);
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ break;
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+#if HAVE_USE_ENV
+ case 'e':
+ use_env(TRUE);
+ break;
+#endif
+ case 'm':
+ m_option = atoi(optarg);
+ break;
+ case 's':
+ s_option = atoi(optarg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
srand((unsigned) time(0));
- initscr();
+ InitAndCatch(initscr(), onsig);
if (has_colors()) {
start_color();
+#if HAVE_USE_DEFAULT_COLORS
+ if (d_option)
+ use_default_colors();
+#endif
for (fg = 0; fg < COLORS; fg++) {
for (bg = 0; bg < COLORS; bg++) {
- int pair = mypair(fg, bg);
+ int pair;
+ if (interrupted) {
+ cleanup();
+ ExitProgram(EXIT_FAILURE);
+ }
+ pair = mypair(fg, bg);
if (pair > 0)
init_pair((short) pair, (short) fg, (short) bg);
}
}
}
- r = (double) (LINES - 4);
- c = (double) (COLS - 4);
+ r = (double) (LINES - (m_option * 2));
+ c = (double) (COLS - (m_option * 2));
started = time((time_t *) 0);
fg = COLOR_WHITE;
bg = COLOR_BLACK;
while (!interrupted) {
- x = (int) (c * ranf()) + 2;
- y = (int) (r * ranf()) + 2;
- p = (ranf() > 0.9) ? '*' : ' ';
+ int x = (int) (c * ranf()) + m_option;
+ int y = (int) (r * ranf()) + m_option;
+ int p = (ranf() > 0.9) ? '*' : ' ';
move(y, x);
if (has_colors()) {
- z = (int) (ranf() * COLORS);
+ int z = (int) (ranf() * COLORS);
if (ranf() > 0.01) {
set_colors(fg = z, bg);
attron(COLOR_PAIR(mypair(fg, bg)));
} else {
set_colors(fg, bg = z);
- napms(1);
+ napms(s_option);
}
} else {
if (ranf() <= 0.01) {
@@ -139,10 +207,10 @@ main(int argc GCC_UNUSED,
} else {
attroff(A_REVERSE);
}
- napms(1);
+ napms(s_option);
}
}
- addch((chtype) p);
+ AddCh(p);
refresh();
++total_chars;
}
diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c
index 90b9c4e..d214ffc 100644
--- a/test/dots_mvcur.c
+++ b/test/dots_mvcur.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2009,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2007-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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey - 2007
*
- * $Id: dots_mvcur.c,v 1.10 2013/09/28 22:44:18 tom Exp $
+ * $Id: dots_mvcur.c,v 1.22 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the terminfo interface, and mvcur.
*/
@@ -40,8 +41,6 @@
#include <time.h>
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
@@ -65,7 +64,7 @@ TPUTS_PROTO(outc, c)
static bool
outs(const char *s)
{
- if (valid(s)) {
+ if (VALID_STRING(s)) {
tputs(s, 1, outc);
return TRUE;
}
@@ -81,7 +80,7 @@ cleanup(void)
outs(clear_screen);
outs(cursor_normal);
- printf("\n\n%ld total chars, rate %.2f/sec\n",
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
total_chars,
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
}
@@ -99,40 +98,117 @@ ranf(void)
return ((double) r / 32768.);
}
+static int
+get_number(NCURSES_CONST char *cap, int map)
+{
+ int result = map;
+ if (cap != 0) {
+ int check = tigetnum(cap);
+ if (check > 0)
+ result = check;
+ }
+ return result;
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: dots_termcap [options]"
+ ,""
+ ,"Options:"
+ ," -T TERM override $TERM"
+#if HAVE_USE_ENV
+ ," -e allow environment $LINES / $COLUMNS"
+#endif
+ ," -f use tigetnum rather than <term.h> mapping"
+ ," -m SIZE set margin (default: 2)"
+ ," -s MSECS delay 1% of the time (default: 1 msecs)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
main(int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
int x0 = 1, y0 = 1;
- int x, y, z, p;
+ int ch;
double r;
double c;
SCREEN *sp;
int my_colors;
+ int f_option = 0;
+ int m_option = 2;
+ int s_option = 1;
+ size_t need;
+ char *my_env;
+
+ while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) {
+ switch (ch) {
+ case 'T':
+ need = 6 + strlen(optarg);
+ my_env = malloc(need);
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ break;
+#if HAVE_USE_ENV
+ case 'e':
+ use_env(TRUE);
+ break;
+#endif
+ case 'f':
+ f_option = 1;
+ break;
+ case 'm':
+ m_option = atoi(optarg);
+ break;
+ case 's':
+ s_option = atoi(optarg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
- CATCHALL(onsig);
+ InitAndCatch((sp = newterm((char *) 0, stdout, stdin)), onsig);
+ refresh(); /* needed with Solaris curses to cancel endwin */
+
+ if (sp == 0) {
+ fprintf(stderr, "Cannot initialize terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
srand((unsigned) time(0));
- sp = newterm((char *) 0, stdout, stdin);
+
outs(clear_screen);
outs(cursor_home);
outs(cursor_invisible);
- my_colors = max_colors;
+
+#define GetNumber(ln,sn) get_number(f_option ? #sn : 0, ln)
+ my_colors = GetNumber(max_colors, colors);
if (my_colors > 1) {
- if (!valid(set_a_foreground)
- || !valid(set_a_background)
- || (!valid(orig_colors) && !valid(orig_pair)))
+ if (!VALID_STRING(set_a_foreground)
+ || !VALID_STRING(set_a_background)
+ || (!VALID_STRING(orig_colors) && !VALID_STRING(orig_pair)))
my_colors = -1;
}
- r = (double) (lines - 4);
- c = (double) (columns - 4);
+ r = (double) (GetNumber(lines, lines) - (m_option * 2));
+ c = (double) (GetNumber(columns, cols) - (m_option * 2));
started = time((time_t *) 0);
while (!interrupted) {
- x = (int) (c * ranf()) + 2;
- y = (int) (r * ranf()) + 2;
- p = (ranf() > 0.9) ? '*' : ' ';
+ int x = (int) (c * ranf()) + m_option;
+ int y = (int) (r * ranf()) + m_option;
+ int p = (ranf() > 0.9) ? '*' : ' ';
if (mvcur(y0, x0, y, x) != ERR) {
x0 = x;
@@ -140,20 +216,20 @@ main(int argc GCC_UNUSED,
}
if (my_colors > 0) {
- z = (int) (ranf() * my_colors);
+ int z = (int) (ranf() * my_colors);
if (ranf() > 0.01) {
tputs(tparm2(set_a_foreground, z), 1, outc);
} else {
tputs(tparm2(set_a_background, z), 1, outc);
- napms(1);
+ napms(s_option);
}
- } else if (valid(exit_attribute_mode)
- && valid(enter_reverse_mode)) {
+ } else if (VALID_STRING(exit_attribute_mode)
+ && VALID_STRING(enter_reverse_mode)) {
if (ranf() <= 0.01) {
outs((ranf() > 0.6)
? enter_reverse_mode
: exit_attribute_mode);
- napms(1);
+ napms(s_option);
}
}
outc(p);
diff --git a/test/dots_termcap.c b/test/dots_termcap.c
index 9918e36..0e442b1 100644
--- a/test/dots_termcap.c
+++ b/test/dots_termcap.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2013 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -29,14 +30,14 @@
/*
* 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.20 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the termcap interface.
*/
#define USE_TINFO
#include <test.priv.h>
-#if !defined(__MINGW32__)
+#if !defined(_WIN32)
#include <sys/time.h>
#endif
@@ -44,8 +45,6 @@
#include <time.h>
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
@@ -62,7 +61,7 @@ static char *t_ve;
static char *t_vi;
static struct {
- const char *name;
+ NCURSES_CONST char *name;
char **value;
} my_caps[] = {
@@ -116,7 +115,7 @@ TPUTS_PROTO(outc, c)
static bool
outs(char *s)
{
- if (valid(s)) {
+ if (VALID_STRING(s)) {
tputs(s, 1, outc);
return TRUE;
}
@@ -132,7 +131,7 @@ cleanup(void)
outs(t_cl);
outs(t_ve);
- printf("\n\n%ld total chars, rate %.2f/sec\n",
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
total_chars,
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
}
@@ -153,38 +152,103 @@ ranf(void)
static void
my_napms(int ms)
{
-#if defined(__MINGW32__) || !HAVE_GETTIMEOFDAY
- Sleep((DWORD) ms);
+ if (ms > 0) {
+#if defined(_WIN32) || !HAVE_GETTIMEOFDAY
+ Sleep((DWORD) ms);
#else
- struct timeval data;
- data.tv_sec = 0;
- data.tv_usec = ms * 1000;
- select(0, NULL, NULL, NULL, &data);
+ struct timeval data;
+ data.tv_sec = 0;
+ data.tv_usec = ms * 1000;
+ select(0, NULL, NULL, NULL, &data);
#endif
+ }
+}
+
+static int
+get_number(NCURSES_CONST char *cap, const char *env)
+{
+ int result = tgetnum(cap);
+ char *value = env ? getenv(env) : 0;
+ if (value != 0 && *value != 0) {
+ char *next = 0;
+ long check = strtol(value, &next, 10);
+ if (check > 0 && *next == '\0')
+ result = (int) check;
+ }
+ return result;
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: dots_termcap [options]"
+ ,""
+ ,"Options:"
+ ," -T TERM override $TERM"
+ ," -e allow environment $LINES / $COLUMNS"
+ ," -m SIZE set margin (default: 2)"
+ ," -s MSECS delay 1% of the time (default: 1 msecs)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
}
int
-main(int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
- int x, y, z, p;
+ int ch;
int num_colors;
int num_lines;
int num_columns;
+ int e_option = 0;
+ int m_option = 2;
+ int s_option = 1;
double r;
double c;
char buffer[1024];
char area[1024];
char *name;
+ size_t need;
+ char *my_env;
- CATCHALL(onsig);
-
- srand((unsigned) time(0));
+ while ((ch = getopt(argc, argv, "T:em:s:")) != -1) {
+ switch (ch) {
+ case 'T':
+ need = 6 + strlen(optarg);
+ my_env = malloc(need);
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ break;
+ case 'e':
+ e_option = 1;
+ break;
+ case 'm':
+ m_option = atoi(optarg);
+ break;
+ case 's':
+ s_option = atoi(optarg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
if ((name = getenv("TERM")) == 0) {
fprintf(stderr, "TERM is not set\n");
ExitProgram(EXIT_FAILURE);
- } else if (tgetent(buffer, name) < 0) {
+ }
+
+ srand((unsigned) time(0));
+
+ InitAndCatch(ch = tgetent(buffer, name), onsig);
+ if (ch < 0) {
fprintf(stderr, "terminal description not found\n");
ExitProgram(EXIT_FAILURE);
} else {
@@ -197,43 +261,44 @@ main(int argc GCC_UNUSED,
}
num_colors = tgetnum("Co");
- num_lines = tgetnum("li");
- num_columns = tgetnum("co");
+#define GetNumber(cap,env) get_number(cap, e_option ? env : 0)
+ num_lines = GetNumber("li", "LINES");
+ num_columns = GetNumber("co", "COLUMNS");
outs(t_cl);
outs(t_vi);
if (num_colors > 1) {
- if (!valid(t_AF)
- || !valid(t_AB)
- || (!valid(t_oc) && !valid(t_op)))
+ if (!VALID_STRING(t_AF)
+ || !VALID_STRING(t_AB)
+ || (!VALID_STRING(t_oc) && !VALID_STRING(t_op)))
num_colors = -1;
}
- r = (double) (num_lines - 4);
- c = (double) (num_columns - 4);
+ r = (double) (num_lines - (2 * m_option));
+ c = (double) (num_columns - (2 * m_option));
started = time((time_t *) 0);
while (!interrupted) {
- x = (int) (c * ranf()) + 2;
- y = (int) (r * ranf()) + 2;
- p = (ranf() > 0.9) ? '*' : ' ';
+ int x = (int) (c * ranf()) + m_option;
+ int y = (int) (r * ranf()) + m_option;
+ int p = (ranf() > 0.9) ? '*' : ' ';
tputs(tgoto(t_cm, x, y), 1, outc);
if (num_colors > 0) {
- z = (int) (ranf() * num_colors);
+ int z = (int) (ranf() * num_colors);
if (ranf() > 0.01) {
tputs(tgoto(t_AF, 0, z), 1, outc);
} else {
tputs(tgoto(t_AB, 0, z), 1, outc);
- my_napms(1);
+ my_napms(s_option);
}
- } else if (valid(t_me)
- && valid(t_mr)) {
+ } else if (VALID_STRING(t_me)
+ && VALID_STRING(t_mr)) {
if (ranf() <= 0.01) {
outs((ranf() > 0.6)
? t_mr
: t_me);
- my_napms(1);
+ my_napms(s_option);
}
}
outc(p);
diff --git a/test/dots_xcurses.c b/test/dots_xcurses.c
new file mode 100644
index 0000000..ba65dab
--- /dev/null
+++ b/test/dots_xcurses.c
@@ -0,0 +1,268 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: dots_xcurses.c,v 1.19 2020/02/02 23:34:34 tom Exp $
+ *
+ * A simple demo of the wide-curses interface used for comparison with termcap.
+ */
+#include <test.priv.h>
+
+#if !defined(_WIN32)
+#include <sys/time.h>
+#endif
+
+#include <time.h>
+
+#if USE_WIDEC_SUPPORT
+
+#if HAVE_ALLOC_PAIR
+#define NewPair(n) x_option ? ((void *)&(n)) : NULL
+#else
+#define NewPair(n) NULL
+#endif
+
+#define InitPair(p,fg,bg) init_pair((short) (p), (short) (fg), (short) (bg))
+
+static bool interrupted = FALSE;
+static long total_chars = 0;
+static time_t started;
+
+#if HAVE_ALLOC_PAIR
+static bool x_option = FALSE;
+#endif
+
+static void
+cleanup(void)
+{
+ endwin();
+
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
+ total_chars,
+ ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
+}
+
+static void
+onsig(int n GCC_UNUSED)
+{
+ interrupted = TRUE;
+}
+
+static double
+ranf(void)
+{
+ long r = (rand() & 077777);
+ return ((double) r / 32768.);
+}
+
+static int
+mypair(int fg, int bg)
+{
+ int result;
+#if HAVE_ALLOC_PAIR
+ if (x_option) {
+ result = alloc_pair(fg, bg);
+ } else
+#endif
+ {
+ int pair = (fg * COLORS) + bg;
+ result = (pair >= COLOR_PAIRS) ? -1 : pair;
+ }
+ return result;
+}
+
+static void
+set_colors(int fg, int bg)
+{
+ int pair = mypair(fg, bg);
+ if (pair > 0) {
+ (void) color_set((short) pair, NewPair(pair));
+ }
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: dots_xcurses [options]"
+ ,""
+ ,"Options:"
+ ," -T TERM override $TERM"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors()"
+#endif
+#if HAVE_USE_ENV
+ ," -e allow environment $LINES / $COLUMNS"
+#endif
+ ," -m SIZE set margin (default: 2)"
+ ," -s MSECS delay 1% of the time (default: 1 msecs)"
+#if HAVE_ALLOC_PAIR
+ ," -x use alloc_pair() rather than init_pair()"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int fg, bg, ch;
+ wchar_t wch[2];
+ double r;
+ double c;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
+ int m_option = 2;
+ int s_option = 1;
+ size_t need;
+ char *my_env;
+
+ while ((ch = getopt(argc, argv, "T:dem:s:x")) != -1) {
+ switch (ch) {
+ case 'T':
+ need = 6 + strlen(optarg);
+ my_env = malloc(need);
+ _nc_SPRINTF(my_env, _nc_SLIMIT(need) "TERM=%s", optarg);
+ putenv(my_env);
+ break;
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+#if HAVE_USE_ENV
+ case 'e':
+ use_env(TRUE);
+ break;
+#endif
+ case 'm':
+ m_option = atoi(optarg);
+ break;
+ case 's':
+ s_option = atoi(optarg);
+ break;
+#if HAVE_ALLOC_PAIR
+ case 'x':
+ x_option = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ break;
+ }
+ }
+
+ srand((unsigned) time(0));
+
+ InitAndCatch(initscr(), onsig);
+ if (has_colors()) {
+ start_color();
+#if HAVE_USE_DEFAULT_COLORS
+ if (d_option)
+ use_default_colors();
+#endif
+#if HAVE_ALLOC_PAIR
+ if (x_option) {
+ ; /* nothing */
+ } else
+#endif
+ {
+ for (fg = 0; fg < COLORS; fg++) {
+ for (bg = 0; bg < COLORS; bg++) {
+ int pair;
+ if (interrupted) {
+ cleanup();
+ ExitProgram(EXIT_FAILURE);
+ }
+ pair = mypair(fg, bg);
+ if (pair > 0) {
+ InitPair(pair, fg, bg);
+ }
+ }
+ }
+ }
+ }
+
+ r = (double) (LINES - (2 * m_option));
+ c = (double) (COLS - (2 * m_option));
+ started = time((time_t *) 0);
+
+ fg = COLOR_WHITE;
+ bg = COLOR_BLACK;
+ wch[1] = 0;
+ while (!interrupted) {
+ int x = (int) (c * ranf()) + m_option;
+ int y = (int) (r * ranf()) + m_option;
+ int p = (ranf() > 0.9) ? '*' : ' ';
+
+ move(y, x);
+ if (has_colors()) {
+ int z = (int) (ranf() * COLORS);
+ if (ranf() > 0.01) {
+ set_colors(fg = z, bg);
+ } else {
+ set_colors(fg, bg = z);
+ napms(s_option);
+ }
+ } else {
+ if (ranf() <= 0.01) {
+ if (ranf() > 0.6) {
+ attr_on(WA_REVERSE, NULL);
+ } else {
+ attr_off(WA_REVERSE, NULL);
+ }
+ napms(s_option);
+ }
+ }
+ wch[0] = (wchar_t) p;
+ addnwstr(wch, 1);
+ refresh();
+ ++total_chars;
+ }
+ cleanup();
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the wide-ncurses library\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/dump_window.c b/test/dump_window.c
new file mode 100644
index 0000000..14a8c9f
--- /dev/null
+++ b/test/dump_window.c
@@ -0,0 +1,179 @@
+/****************************************************************************
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: dump_window.c,v 1.4 2020/02/02 23:34:34 tom Exp $
+ */
+#include <dump_window.h>
+
+static FILE *dumpfp;
+
+int
+open_dump(const char *fn)
+{
+ int result = 0;
+ close_dump();
+ if ((dumpfp = fopen(fn, "a")) != 0)
+ result = 1;
+ return result;
+}
+
+void
+close_dump(void)
+{
+ if (dumpfp != 0) {
+ fclose(dumpfp);
+ dumpfp = 0;
+ }
+}
+
+void
+dump_window(WINDOW *w)
+{
+ wgetch(w);
+ if (dumpfp != 0) {
+ int y, x;
+ int oldy, oldx;
+ int maxy, maxx;
+ int pass;
+ char *cvec = 0;
+ char *avec = 0;
+ char *pvec = 0;
+ int ccnt = 0;
+ int acnt = 0;
+ int pcnt = 0;
+ int endy = -1;
+ int endx = -1;
+
+ fprintf(dumpfp, "Window %p\n", (void *) w);
+
+ getyx(w, oldy, oldx);
+ getmaxyx(w, maxy, maxx);
+ fprintf(dumpfp, "size (%dx%d)\n", maxy, maxx);
+ getbegyx(w, y, x);
+ fprintf(dumpfp, "begin (%dx%d)\n", maxy, maxx);
+ getyx(w, y, x);
+ fprintf(dumpfp, "position (%d,%d)\n", y, x);
+
+ if (maxy > 0 && maxx > 0) {
+ for (pass = 0; pass < 2; ++pass) {
+ for (y = 0; y < maxy; ++y) {
+
+ if (cvec)
+ memset(cvec, 0, (size_t) maxx + 1);
+ if (avec)
+ memset(avec, 0, (size_t) maxx + 1);
+ if (pvec)
+ memset(pvec, 0, (size_t) maxx + 1);
+
+ for (x = 0; x < maxx; ++x) {
+ chtype data = mvwinch(w, y, x);
+ chtype temp;
+ char cc = (char) ((data & 0xff) ? (data & 0xff) : ' ');
+ char aa;
+ char pp;
+
+ temp = ((data & A_ATTRIBUTES) & (~A_COLOR));
+ if (temp) {
+ if (temp & A_ALTCHARSET) {
+ aa = (temp & A_BOLD) ? 'A' : 'a';
+ } else if (temp & A_STANDOUT) {
+ aa = (temp & A_BOLD) ? 'S' : 's';
+ } else if (temp & A_REVERSE) {
+ aa = (temp & A_BOLD) ? 'R' : 'r';
+ } else if (temp & A_UNDERLINE) {
+ aa = (temp & A_BOLD) ? 'U' : 'u';
+ } else {
+ aa = (temp & A_BOLD) ? 'b' : '?';
+ }
+ } else {
+ aa = ' ';
+ }
+ if (data & A_COLOR) {
+ if (PAIR_NUMBER((int) data) < 8) {
+ pp = (char) ('0' + PAIR_NUMBER((int) data));
+ } else {
+ pp = '*';
+ }
+ } else {
+ pp = ' ';
+ }
+
+ if (pass) {
+ if (cvec)
+ cvec[x] = cc;
+ if (avec)
+ avec[x] = aa;
+ if (pvec)
+ pvec[x] = pp;
+ } else {
+ if (cc != ' ' || aa != ' ' || pp != ' ') {
+ if (endx < x)
+ endx = x;
+ if (endy < y)
+ endy = y;
+ }
+ ccnt += (cc != ' ');
+ acnt += (aa != ' ');
+ pcnt += (pp != ' ');
+ }
+ }
+ if (pass) {
+ fprintf(dumpfp, "%3d", y + 1);
+ if (cvec)
+ fprintf(dumpfp, "\tc|%.*s|\n", maxx, cvec);
+ if (avec)
+ fprintf(dumpfp, "\ta|%.*s|\n", maxx, avec);
+ if (pvec)
+ fprintf(dumpfp, "\tp|%.*s|\n", maxx, pvec);
+ }
+ }
+ if (pass) {
+ free(cvec);
+ free(avec);
+ free(pvec);
+ } else {
+ fprintf(dumpfp, "%d cells with characters\n", ccnt);
+ fprintf(dumpfp, "%d cells with video-attributes\n", acnt);
+ fprintf(dumpfp, "%d cells with color-attributes\n", pcnt);
+ if (endy < 0 || endx < 0)
+ break;
+ /* reduce the dump a little, ignore really blank cells */
+ maxx = endx + 1;
+ maxy = endy + 1;
+ if (ccnt)
+ cvec = malloc((size_t) maxx + 1);
+ if (acnt)
+ avec = malloc((size_t) maxx + 1);
+ if (pcnt)
+ pvec = malloc((size_t) maxx + 1);
+ }
+ }
+ }
+ wmove(w, oldy, oldx);
+ }
+}
diff --git a/test/dump_window.h b/test/dump_window.h
new file mode 100644
index 0000000..865249e
--- /dev/null
+++ b/test/dump_window.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: dump_window.h,v 1.2 2020/02/02 23:34:34 tom Exp $
+ */
+#ifndef DUMP_WINDOW_H_incl
+#define DUMP_WINDOW_H_incl 1
+
+#include <test.priv.h>
+
+extern int open_dump(const char *fn);
+extern void close_dump(void);
+extern void dump_window(WINDOW *w);
+
+#endif /* DUMP_WINDOW_H_incl */
diff --git a/test/echochar.c b/test/echochar.c
index c9ac29a..ce7f03d 100644
--- a/test/echochar.c
+++ b/test/echochar.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2006-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2006-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: echochar.c,v 1.10 2014/08/09 22:35:51 tom Exp $
+ * $Id: echochar.c,v 1.21 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the echochar function (compare to dots.c).
* Thomas Dickey - 2006/11/4
@@ -36,8 +37,6 @@
#include <time.h>
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static bool interrupted = FALSE;
static long total_chars = 0;
static time_t started;
@@ -45,9 +44,9 @@ static time_t started;
static void
cleanup(void)
{
- endwin();
+ stop_curses();
- printf("\n\n%ld total chars, rate %.2f/sec\n",
+ printf("\n\n%ld total cells, rate %.2f/sec\n",
total_chars,
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
}
@@ -69,19 +68,21 @@ static void
set_color(char *my_pairs, int fg, int bg)
{
int pair = (fg * COLORS) + bg;
- if (!my_pairs[pair]) {
- init_pair((short) pair,
- (short) fg,
- (short) bg);
+ if (pair < COLOR_PAIRS) {
+ if (!my_pairs[pair]) {
+ init_pair((short) pair,
+ (short) fg,
+ (short) bg);
+ }
+ attron(COLOR_PAIR(pair));
}
- attron(COLOR_PAIR(pair));
}
int
main(int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
- int ch, x, y, z, p;
+ int ch;
double r;
double c;
bool use_colors;
@@ -96,13 +97,12 @@ main(int argc GCC_UNUSED,
opt_r = TRUE;
break;
default:
- fprintf(stderr, "usage: echochar [-r]\n");
+ fprintf(stderr, "Usage: echochar [-r]\n");
ExitProgram(EXIT_FAILURE);
}
}
- CATCHALL(onsig);
- initscr();
+ InitAndCatch(initscr(), onsig);
use_colors = has_colors();
if (use_colors) {
@@ -122,13 +122,13 @@ main(int argc GCC_UNUSED,
started = time((time_t *) 0);
while (!interrupted) {
- x = (int) (c * ranf()) + 2;
- y = (int) (r * ranf()) + 2;
- p = (ranf() > 0.9) ? '*' : ' ';
+ int x = (int) (c * ranf()) + 2;
+ int y = (int) (r * ranf()) + 2;
+ int p = (ranf() > 0.9) ? '*' : ' ';
move(y, x);
if (use_colors > 0) {
- z = (int) (ranf() * COLORS);
+ int z = (int) (ranf() * COLORS);
if (ranf() > 0.01) {
set_color(my_pairs, z, last_bg);
last_fg = z;
@@ -147,7 +147,7 @@ main(int argc GCC_UNUSED,
}
}
if (opt_r) {
- addch(UChar(p));
+ AddCh(UChar(p));
refresh();
} else {
echochar(UChar(p));
@@ -155,5 +155,6 @@ main(int argc GCC_UNUSED,
++total_chars;
}
cleanup();
+ free(my_pairs);
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/edit_field.c b/test/edit_field.c
index 8c58cd6..b2b2084 100644
--- a/test/edit_field.c
+++ b/test/edit_field.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.c,v 1.24 2014/09/05 08:39:52 tom Exp $
+ * $Id: edit_field.c,v 1.31 2020/02/02 23:34:34 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 +41,7 @@
#if USE_LIBFORM
#include <edit_field.h>
+#include <popup_msg.h>
static struct {
int code;
@@ -169,151 +171,71 @@ 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 *, 3 + 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);
+ _nc_SPRINTF(msg, _nc_SLIMIT(need) "%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;
form_getyx(form, currow, curcol);
- return curcol + currow * field->dcols;
+ return curcol + currow * (int) field->dcols;
}
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 +245,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 +270,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;
@@ -404,12 +326,12 @@ edit_field(FORM * form, int *result)
if (before_col > 0) {
--length;
} else if (before_row > 0) {
- length -= before->cols + before_col;
+ length -= (int) before->cols + before_col;
}
}
break;
case REQ_NEW_LINE:
- length += before->cols;
+ length += (int) before->cols;
break;
#if 0
/* FIXME: finish these */
@@ -494,6 +416,16 @@ edit_field(FORM * form, int *result)
inactive_field(before);
return status;
}
+
+void
+free_edit_field(FIELD *f)
+{
+ FieldAttrs *ptr = field_attrs(f);
+ if (ptr != 0) {
+ free(ptr->row_lengths);
+ free(ptr);
+ }
+}
#else
extern void no_edit_field(void);
diff --git a/test/edit_field.h b/test/edit_field.h
index 3c5b80e..ad9e6a5 100644
--- a/test/edit_field.h
+++ b/test/edit_field.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2003-2008,2013 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: edit_field.h,v 1.9 2013/06/08 15:46:01 tom Exp $
+ * $Id: edit_field.h,v 1.11 2020/02/02 23:34:34 tom Exp $
*
* Interface of edit_field.c
*/
@@ -49,9 +50,10 @@ typedef struct {
int *row_lengths;
} FieldAttrs;
-extern FieldAttrs *field_attrs(FIELD * field);
-extern void init_edit_field(FIELD * field, char *value);
+extern FieldAttrs *field_attrs(FIELD *field);
+extern void init_edit_field(FIELD *field, char *value);
extern void help_edit_field(void);
-extern int edit_field(FORM * form, int *result);
+extern int edit_field(FORM *form, int *result);
+extern void free_edit_field(FIELD *field);
#endif /* EDIT_FORM_H_incl */
diff --git a/test/escherknot.xbm b/test/escherknot.xbm
new file mode 100644
index 0000000..80bc471
--- /dev/null
+++ b/test/escherknot.xbm
@@ -0,0 +1,473 @@
+#define escherknot_width 216
+#define escherknot_height 208
+
+static char escherknot_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x5f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0x6f, 0xf6, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0x3a, 0x13, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0d, 0x02, 0x51, 0x71, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0x20, 0xd9, 0x88,
+ 0x9b, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x82,
+ 0xac, 0x44, 0x4e, 0x1c, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1e, 0x40, 0x02, 0x44, 0x60, 0xe2, 0xfc, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x25, 0x09, 0x90, 0x22, 0x13, 0xb7, 0x9a, 0x1e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x10, 0x89,
+ 0x18, 0xe3, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x04, 0x08,
+ 0x01, 0x10, 0xc8, 0xa8, 0xd5, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x83, 0x80, 0x20, 0x40, 0x82, 0x00, 0x66, 0x9c, 0xec, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x24, 0x12, 0x93, 0x5b,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x12, 0x80, 0x04, 0x01, 0x00, 0x80,
+ 0x19, 0x33, 0xfa, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x80, 0x00,
+ 0x20, 0x08, 0x12, 0xc4, 0x68, 0x26, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x02, 0x04, 0x24, 0x00, 0x01, 0x40, 0x24, 0x8c, 0xcd, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x80, 0x49, 0x10, 0x90, 0x00, 0x21, 0x20, 0x08, 0x11, 0x43, 0xd9,
+ 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8,
+ 0xff, 0xff, 0x0b, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x30, 0xb9, 0xf2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x97, 0x04, 0x08, 0xfe, 0x05, 0x30, 0x10, 0x12, 0x20, 0x20,
+ 0x04, 0x00, 0x80, 0x48, 0x0c, 0xa3, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3e, 0x92, 0x20, 0x49, 0x40, 0x3e, 0x0e, 0x82,
+ 0x00, 0x84, 0x25, 0x01, 0x80, 0x00, 0x80, 0xc8, 0x34, 0xed, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x25, 0x01, 0x04, 0x01, 0x08,
+ 0xd0, 0x17, 0x00, 0x80, 0x25, 0x01, 0xad, 0x04, 0x12, 0x20, 0x23, 0x4c,
+ 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x48,
+ 0x92, 0x20, 0x41, 0x92, 0x9e, 0x80, 0x24, 0x24, 0x29, 0x00, 0x04, 0x00,
+ 0x10, 0x98, 0xcc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x4f, 0x10, 0x01, 0x90, 0x24, 0x40, 0x12, 0xf0, 0x00, 0x24, 0x41, 0x0b,
+ 0xa9, 0x10, 0x00, 0x00, 0x04, 0xd9, 0x96, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x00, 0x92, 0x48, 0x02, 0x04, 0x09, 0xc0, 0x84, 0x8f,
+ 0x29, 0x2d, 0xf8, 0xa9, 0x02, 0x00, 0x00, 0x20, 0x90, 0xf4, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x24, 0x91, 0x04, 0x50, 0x22, 0x24,
+ 0x1b, 0x12, 0x7a, 0x48, 0xca, 0x03, 0x21, 0x10, 0x00, 0x00, 0x48, 0x93,
+ 0xff, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x24, 0x92, 0x20,
+ 0x81, 0xda, 0x24, 0xc8, 0x16, 0xd0, 0xe7, 0x50, 0xd2, 0xbf, 0x03, 0x00,
+ 0x80, 0x00, 0x30, 0x29, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+ 0x20, 0x80, 0x24, 0x41, 0x12, 0x2a, 0x41, 0xb2, 0x80, 0x33, 0x0e, 0x7e,
+ 0x88, 0x1c, 0x01, 0x00, 0xa0, 0x24, 0x69, 0x75, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x82, 0x44, 0x11, 0x24, 0x09, 0x90, 0xa4, 0x4d, 0xd2, 0x92,
+ 0x9e, 0xd3, 0x83, 0x6b, 0x62, 0x00, 0x00, 0x10, 0x22, 0xff, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x30, 0x42, 0x04, 0x92, 0x24, 0x6b, 0x53, 0x32,
+ 0x59, 0x90, 0x16, 0xfa, 0xb4, 0xf4, 0xff, 0x0f, 0x01, 0x00, 0x90, 0x68,
+ 0x4a, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x90, 0x24, 0x11, 0x24,
+ 0x49, 0xda, 0x82, 0xc5, 0x92, 0xd2, 0xd0, 0x9e, 0x1e, 0x00, 0x78, 0x0a,
+ 0x00, 0x00, 0x05, 0xd2, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x02,
+ 0x44, 0xb2, 0x65, 0xea, 0x49, 0x9e, 0x2c, 0x4b, 0x1a, 0xd2, 0xeb, 0xe3,
+ 0xff, 0xc7, 0x09, 0x00, 0x20, 0x68, 0xff, 0xd6, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x0b, 0x90, 0x40, 0x92, 0x24, 0x09, 0x5f, 0xd2, 0x64, 0x59, 0x72,
+ 0x56, 0x7f, 0xfd, 0xdf, 0x1f, 0x12, 0x00, 0x20, 0x49, 0x92, 0xde, 0x01,
+ 0x00, 0x00, 0x00, 0x80, 0x41, 0x92, 0x4c, 0x92, 0x24, 0x25, 0xc9, 0x8b,
+ 0x2e, 0xcb, 0x92, 0x4b, 0x5a, 0x2f, 0x75, 0xf4, 0x04, 0x00, 0x00, 0x41,
+ 0xf6, 0x74, 0x01, 0x00, 0x00, 0x00, 0x40, 0x49, 0x02, 0x00, 0xba, 0xb6,
+ 0xfd, 0x49, 0xf8, 0x74, 0x6d, 0x4b, 0x72, 0xed, 0xdb, 0xff, 0xcf, 0x53,
+ 0x00, 0x00, 0x48, 0xb6, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x60, 0x48, 0x10,
+ 0xc9, 0x93, 0x24, 0x00, 0x7b, 0xc3, 0xa6, 0x69, 0x58, 0x5a, 0xfb, 0xfa,
+ 0xa5, 0xbe, 0x16, 0x00, 0x00, 0x92, 0xa4, 0xfd, 0x03, 0x00, 0x00, 0x00,
+ 0x30, 0x01, 0x20, 0x5d, 0xa2, 0xfe, 0x7f, 0x01, 0x4f, 0x1a, 0xcd, 0x6b,
+ 0x6a, 0xa9, 0x5f, 0xff, 0xf3, 0x24, 0x01, 0x40, 0xc0, 0xb4, 0xf4, 0x03,
+ 0x00, 0x00, 0x00, 0x2c, 0x88, 0x84, 0x89, 0xb6, 0x00, 0x24, 0x7d, 0x69,
+ 0xf2, 0x34, 0xad, 0x99, 0x2d, 0xf7, 0xff, 0x9f, 0x4b, 0x00, 0x00, 0x92,
+ 0xa6, 0xad, 0x07, 0x00, 0x00, 0x00, 0x06, 0x91, 0x24, 0xe9, 0xa4, 0xfd,
+ 0xa5, 0xa9, 0x4b, 0x93, 0xe7, 0x34, 0x63, 0xf9, 0xfc, 0xd5, 0xef, 0x16,
+ 0x00, 0x40, 0x90, 0xb4, 0xbd, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x80, 0x4c,
+ 0x96, 0xbe, 0x2d, 0xfd, 0x2f, 0x7c, 0x5e, 0x9c, 0x67, 0xad, 0xa5, 0xfd,
+ 0xff, 0xbf, 0x29, 0x00, 0x00, 0x92, 0x76, 0xed, 0x06, 0x00, 0x00, 0x00,
+ 0x05, 0x12, 0x48, 0x53, 0x25, 0x65, 0x25, 0xf4, 0xe5, 0xd3, 0x72, 0x9c,
+ 0x35, 0xdf, 0xf6, 0x7f, 0xf5, 0x56, 0x00, 0x00, 0x92, 0xa4, 0xed, 0x0f,
+ 0x00, 0x00, 0x80, 0x49, 0x20, 0x59, 0x38, 0xec, 0xff, 0xff, 0xad, 0x2f,
+ 0x5d, 0xd3, 0x33, 0xe6, 0x24, 0xed, 0xff, 0xdf, 0x2d, 0x01, 0x40, 0x80,
+ 0x24, 0xbd, 0x07, 0x00, 0x00, 0xc0, 0x48, 0x24, 0x49, 0x87, 0x37, 0x21,
+ 0xa0, 0xbd, 0xf4, 0x79, 0x4f, 0xc7, 0x9c, 0xde, 0xf6, 0xff, 0xff, 0x5b,
+ 0x08, 0x00, 0x92, 0xfc, 0xe9, 0x0e, 0x00, 0x00, 0x20, 0x89, 0x40, 0xd3,
+ 0xf4, 0x49, 0xff, 0xff, 0xe7, 0x2f, 0xcf, 0x79, 0x9c, 0x53, 0xb2, 0x35,
+ 0xff, 0xff, 0x37, 0x00, 0x40, 0x90, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x30,
+ 0x91, 0x49, 0x32, 0x2d, 0xff, 0x6b, 0xb7, 0xbd, 0xbc, 0x3c, 0xef, 0x79,
+ 0xce, 0xde, 0xd6, 0xfd, 0xff, 0x9f, 0x00, 0x00, 0x92, 0xa6, 0xad, 0x0b,
+ 0x00, 0x00, 0x30, 0x11, 0x89, 0x8c, 0xcb, 0x5b, 0xba, 0xaf, 0xf6, 0xd7,
+ 0xe7, 0x35, 0xe7, 0x59, 0xb3, 0xfb, 0xff, 0xff, 0x7f, 0x04, 0x40, 0x80,
+ 0xe4, 0xb9, 0x1f, 0x00, 0x00, 0x48, 0x22, 0x91, 0x66, 0x79, 0xeb, 0xff,
+ 0xff, 0xdf, 0xbe, 0xbe, 0xe7, 0x8c, 0x75, 0x6b, 0x4a, 0xfa, 0xbf, 0x7f,
+ 0x00, 0x00, 0x82, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x4c, 0x22, 0xb2, 0x79,
+ 0x5e, 0xfa, 0x5b, 0xa9, 0xfd, 0xeb, 0xf5, 0x9c, 0x3d, 0xc6, 0xcc, 0xee,
+ 0xed, 0x01, 0xf8, 0x00, 0x40, 0x82, 0xb6, 0xa9, 0x1b, 0x00, 0x00, 0x94,
+ 0x64, 0x66, 0x8e, 0xd3, 0x97, 0xfe, 0xff, 0xd7, 0xdf, 0x9f, 0x7b, 0xf3,
+ 0x3c, 0x35, 0x59, 0x6b, 0x00, 0x70, 0x00, 0x00, 0x40, 0xe4, 0xed, 0x1e,
+ 0x00, 0x00, 0x92, 0xc4, 0x34, 0xf3, 0xfc, 0xfd, 0x5f, 0xad, 0x7d, 0xfa,
+ 0x7a, 0xce, 0x8e, 0xb3, 0x76, 0x2f, 0xfd, 0x00, 0xe0, 0x04, 0x00, 0x9a,
+ 0x26, 0xaf, 0x1e, 0x00, 0x00, 0x13, 0x88, 0xcc, 0xb5, 0x3f, 0xbf, 0xff,
+ 0xff, 0xd7, 0xef, 0xef, 0xbd, 0x79, 0x6a, 0xde, 0xec, 0xab, 0x01, 0xc0,
+ 0x00, 0x00, 0x40, 0xb6, 0xbd, 0x1b, 0x00, 0x00, 0x05, 0x91, 0xeb, 0x5c,
+ 0xeb, 0xeb, 0xff, 0xff, 0xff, 0x7e, 0xef, 0x6b, 0xef, 0xcd, 0x99, 0xb3,
+ 0xe4, 0x07, 0x80, 0x00, 0x40, 0x49, 0xb2, 0xe5, 0x1a, 0x00, 0x80, 0x20,
+ 0x32, 0xb1, 0xe7, 0x79, 0x7f, 0xf7, 0xff, 0xfd, 0xeb, 0xbd, 0xfe, 0x2c,
+ 0x3d, 0x6b, 0xb6, 0xaf, 0x06, 0x80, 0x00, 0x00, 0x41, 0x96, 0xfe, 0x1e,
+ 0x00, 0x80, 0x44, 0xb2, 0x9b, 0xf9, 0xde, 0xff, 0xff, 0xff, 0x7f, 0xbf,
+ 0xf7, 0xbb, 0xb3, 0x77, 0xce, 0xce, 0xb6, 0x0d, 0x80, 0x01, 0x00, 0x49,
+ 0xf2, 0x94, 0x1f, 0x00, 0x40, 0x49, 0x44, 0xe6, 0x9e, 0x77, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xbf, 0xf7, 0x7e, 0xd6, 0xbc, 0xd9, 0xba, 0x3b, 0x80,
+ 0x00, 0x00, 0x64, 0x93, 0xf7, 0x1b, 0x00, 0x40, 0x89, 0xec, 0x7e, 0x67,
+ 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xdb, 0x99, 0x33, 0x37,
+ 0xd3, 0x36, 0x80, 0x01, 0x80, 0x24, 0xda, 0xd6, 0x1e, 0x00, 0x20, 0x90,
+ 0x99, 0x99, 0x7b, 0xef, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xef, 0xbd, 0x37,
+ 0x63, 0xf3, 0x66, 0xdb, 0x7a, 0x80, 0x00, 0x00, 0x24, 0x59, 0xde, 0x1f,
+ 0x00, 0x60, 0x12, 0xb3, 0xf7, 0xdd, 0xfb, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xbf, 0xf7, 0xfe, 0x6e, 0xce, 0xdd, 0x6d, 0xd7, 0x80, 0x00, 0x80, 0x20,
+ 0xcb, 0xfb, 0x1f, 0x00, 0x10, 0x20, 0x6e, 0x66, 0x76, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xde, 0xdb, 0x9b, 0x99, 0xb3, 0x5d, 0x6b, 0x81,
+ 0x00, 0x40, 0x96, 0x59, 0x6a, 0x1f, 0x00, 0x98, 0xc4, 0xe4, 0xdf, 0xff,
+ 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x6f, 0x7b, 0x37, 0x7f,
+ 0xb3, 0xdd, 0x83, 0x00, 0x00, 0xb0, 0xed, 0xef, 0x1d, 0x00, 0x10, 0x88,
+ 0x9e, 0xdd, 0xcd, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xed,
+ 0x6c, 0xe6, 0xcc, 0x76, 0x6d, 0xc1, 0x00, 0x40, 0x91, 0x24, 0x7b, 0x1f,
+ 0x00, 0x08, 0xd1, 0xf1, 0x66, 0x76, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xdf, 0xbd, 0xbf, 0xd9, 0xdd, 0xdd, 0xb6, 0x47, 0x00, 0x00, 0xd8,
+ 0xb4, 0xad, 0x1f, 0x00, 0x24, 0x24, 0x6f, 0xf6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xb7, 0x9d, 0x33, 0xd9, 0x96, 0x4e,
+ 0x00, 0x20, 0x49, 0xf7, 0xfd, 0x1e, 0x00, 0x48, 0xe4, 0xac, 0xb9, 0xdd,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xdd, 0x76, 0xb6,
+ 0xb7, 0xfd, 0x7a, 0x00, 0x00, 0x44, 0x96, 0xb7, 0x1f, 0x00, 0x02, 0x9a,
+ 0xbe, 0x6f, 0x77, 0xff, 0xff, 0x7f, 0x61, 0xd9, 0xff, 0xff, 0xff, 0xfd,
+ 0xdd, 0x66, 0xed, 0x66, 0x5b, 0x37, 0x00, 0x90, 0x64, 0xb9, 0xf6, 0x1f,
+ 0x00, 0x02, 0xc9, 0xf3, 0xee, 0xfd, 0xff, 0xff, 0x2f, 0x24, 0x4f, 0xfe,
+ 0xff, 0xff, 0x7f, 0x37, 0xdb, 0xcd, 0x7c, 0xff, 0x3a, 0x00, 0x88, 0x24,
+ 0xdb, 0xde, 0x1a, 0x00, 0x13, 0x31, 0x6f, 0xbb, 0xdf, 0xff, 0xff, 0x21,
+ 0xa0, 0x64, 0xf3, 0xff, 0xff, 0xe7, 0xff, 0x96, 0xbb, 0x9b, 0xa5, 0x1d,
+ 0x00, 0x60, 0x32, 0xe9, 0xdb, 0x0f, 0x00, 0x65, 0xe6, 0x3c, 0xfb, 0xf6,
+ 0xff, 0x7f, 0x10, 0xa4, 0xb5, 0x9d, 0xfe, 0xdf, 0xdf, 0xdd, 0x6d, 0x32,
+ 0xb3, 0x7d, 0x0d, 0x00, 0x0b, 0x93, 0x7c, 0x7b, 0x0f, 0x00, 0x89, 0xdc,
+ 0xb3, 0xed, 0xfb, 0xff, 0x1f, 0x10, 0x90, 0x92, 0xd9, 0xfe, 0x7f, 0xff,
+ 0x77, 0xdb, 0xee, 0x6e, 0xdb, 0x0e, 0x00, 0x20, 0xdd, 0x66, 0x6f, 0x0f,
+ 0x80, 0x91, 0x5a, 0xfb, 0xbe, 0xef, 0xff, 0x0f, 0x10, 0xda, 0x92, 0xee,
+ 0xff, 0xff, 0xff, 0xf7, 0xb7, 0xcd, 0xee, 0xde, 0x07, 0x00, 0x24, 0x49,
+ 0xb6, 0xed, 0x0f, 0x00, 0x12, 0x6b, 0xcd, 0xf3, 0xbe, 0xff, 0x07, 0x08,
+ 0x48, 0xda, 0x76, 0xb7, 0xff, 0xff, 0xdd, 0x6e, 0xba, 0x99, 0x65, 0x03,
+ 0x40, 0x92, 0xe4, 0xba, 0xbd, 0x0e, 0x80, 0x62, 0xed, 0x7d, 0x5f, 0xf7,
+ 0xff, 0x01, 0x08, 0x28, 0xc9, 0x26, 0xbb, 0xff, 0xff, 0xff, 0x99, 0xb7,
+ 0xbb, 0x7d, 0x03, 0x00, 0x89, 0x64, 0xdb, 0xf6, 0x07, 0x40, 0x0c, 0x35,
+ 0xe7, 0x79, 0xdd, 0xff, 0x01, 0x84, 0xa5, 0x7d, 0xba, 0xdd, 0xfe, 0x7f,
+ 0xbf, 0xbf, 0x6d, 0x76, 0xdb, 0x01, 0x00, 0x48, 0x36, 0xdb, 0xd6, 0x07,
+ 0xc0, 0x88, 0xb4, 0xb6, 0xbf, 0xff, 0x7f, 0x00, 0x0c, 0x24, 0x44, 0xdb,
+ 0xed, 0xff, 0xdf, 0xef, 0x6e, 0xdb, 0x6e, 0xb7, 0x00, 0x80, 0x44, 0x93,
+ 0xed, 0x5b, 0x07, 0x40, 0x91, 0xd2, 0xfa, 0xfc, 0xf6, 0x7f, 0x00, 0x02,
+ 0xb4, 0x35, 0xd9, 0xef, 0xff, 0xff, 0xfb, 0xef, 0xb6, 0xc9, 0xe4, 0x00,
+ 0x10, 0x24, 0xd9, 0x6d, 0xfb, 0x03, 0x00, 0x27, 0xfe, 0xd3, 0xd6, 0xdb,
+ 0x3f, 0x00, 0xa2, 0x94, 0xb4, 0xdb, 0x7c, 0xff, 0xff, 0xbf, 0xd9, 0xad,
+ 0xdb, 0x7d, 0x00, 0x40, 0x32, 0xd9, 0xb6, 0xef, 0x03, 0x60, 0xe4, 0x5a,
+ 0x5f, 0x5f, 0xff, 0x1f, 0x00, 0x02, 0x52, 0x92, 0xec, 0xb6, 0xff, 0xff,
+ 0xef, 0xff, 0x6d, 0xb6, 0x3b, 0x00, 0x28, 0x90, 0xcc, 0xbe, 0xfd, 0x03,
+ 0xa0, 0x88, 0xeb, 0xf9, 0xfd, 0xf5, 0x1f, 0x00, 0x82, 0x53, 0xbb, 0x6d,
+ 0xf7, 0xff, 0xf9, 0xff, 0x6f, 0xdb, 0x6d, 0x1b, 0x00, 0x04, 0xc9, 0x66,
+ 0xdb, 0x57, 0x03, 0xa0, 0x52, 0xaf, 0xa7, 0x97, 0xff, 0x0f, 0x00, 0x51,
+ 0x48, 0xda, 0x66, 0xdb, 0xff, 0xf8, 0xdf, 0xed, 0xbe, 0xed, 0x0e, 0x00,
+ 0x92, 0x64, 0x32, 0xeb, 0xf6, 0x01, 0x20, 0x63, 0xbd, 0xbc, 0xfc, 0xfa,
+ 0x0f, 0x00, 0x09, 0x20, 0x89, 0x3e, 0xff, 0xff, 0xe0, 0x7f, 0xdf, 0x6f,
+ 0xdb, 0x07, 0x00, 0x01, 0x24, 0xbb, 0xed, 0xfe, 0x01, 0xa0, 0xce, 0xf5,
+ 0xf6, 0xdb, 0xdf, 0x07, 0x00, 0x41, 0xad, 0x5f, 0xf2, 0xed, 0xff, 0xc0,
+ 0xff, 0xbf, 0xdd, 0x92, 0x03, 0x00, 0x44, 0xb2, 0xd9, 0x7d, 0xfb, 0x01,
+ 0xe0, 0xaa, 0xdf, 0x9b, 0x7f, 0xfb, 0x07, 0x80, 0x28, 0x21, 0x64, 0xbb,
+ 0x7f, 0x7f, 0x80, 0xff, 0xf6, 0xbb, 0xee, 0x03, 0x80, 0x22, 0x99, 0xed,
+ 0xb6, 0xff, 0x00, 0x90, 0xb8, 0x5e, 0x5b, 0x6b, 0xed, 0x03, 0x00, 0x01,
+ 0xa6, 0x6d, 0xdb, 0xf6, 0x7f, 0x00, 0xff, 0xff, 0xf6, 0xcd, 0x00, 0x40,
+ 0x10, 0xc9, 0x6c, 0xff, 0xf7, 0x00, 0xa0, 0xe3, 0x72, 0xeb, 0xef, 0xff,
+ 0x03, 0x80, 0xe0, 0x90, 0x24, 0xdb, 0xbd, 0x3f, 0x00, 0xfe, 0xdb, 0x6f,
+ 0xfb, 0x00, 0x00, 0x89, 0x4c, 0xb6, 0xd9, 0x7e, 0x00, 0x70, 0xaf, 0xaf,
+ 0x6f, 0xb5, 0xde, 0x03, 0x80, 0x94, 0x92, 0xb6, 0xf9, 0xf6, 0x3f, 0x00,
+ 0xfc, 0xbf, 0xdd, 0x7b, 0x00, 0x10, 0x48, 0x26, 0xb3, 0xdf, 0x7f, 0x00,
+ 0x70, 0xd8, 0xae, 0xfd, 0xff, 0xf7, 0x03, 0x80, 0x00, 0xd2, 0x36, 0xcf,
+ 0xdf, 0x3f, 0x00, 0xb8, 0x6d, 0xdf, 0x16, 0x00, 0x48, 0x44, 0xb2, 0xfb,
+ 0x6c, 0x3f, 0x00, 0x50, 0x75, 0xfd, 0xa5, 0xd5, 0xfe, 0x01, 0x40, 0xd1,
+ 0x12, 0xa2, 0x7d, 0xfb, 0x1f, 0x00, 0xf0, 0xff, 0xbf, 0x0d, 0x00, 0x20,
+ 0x12, 0x9b, 0xcd, 0xf6, 0x3f, 0x00, 0x90, 0xd5, 0xa7, 0xfd, 0x77, 0xab,
+ 0x03, 0x40, 0x1c, 0xc8, 0xbe, 0x6d, 0xfb, 0x1f, 0x00, 0xe0, 0xff, 0xee,
+ 0x07, 0x00, 0x04, 0x91, 0xc9, 0x7e, 0xbf, 0x1f, 0x00, 0x30, 0x57, 0xbf,
+ 0xa6, 0xde, 0xfd, 0x01, 0x40, 0x40, 0x6b, 0xd3, 0x6e, 0xef, 0x0f, 0x00,
+ 0xc0, 0xeb, 0x7d, 0x03, 0x00, 0x90, 0xc8, 0x6c, 0x76, 0xfb, 0x0f, 0x00,
+ 0x70, 0x5c, 0xe5, 0xf7, 0xfa, 0xeb, 0x01, 0x40, 0x50, 0x49, 0x92, 0xf4,
+ 0xfd, 0x0f, 0x00, 0xc0, 0xff, 0xdb, 0x01, 0x80, 0x44, 0x44, 0x66, 0xbb,
+ 0x6f, 0x0f, 0x00, 0xd0, 0xf1, 0x95, 0xf6, 0x6f, 0xad, 0x01, 0x40, 0x08,
+ 0x78, 0xdb, 0xb6, 0xef, 0x0f, 0x00, 0x00, 0xdf, 0xd6, 0x00, 0x00, 0x20,
+ 0x32, 0xb3, 0xdb, 0xfd, 0x0f, 0x00, 0x10, 0xd7, 0xf7, 0xb6, 0xd8, 0xeb,
+ 0x03, 0x20, 0x43, 0x27, 0xd9, 0xb6, 0xfd, 0x0f, 0x00, 0x00, 0xff, 0x7e,
+ 0x00, 0x40, 0x12, 0x93, 0xd9, 0xec, 0xb6, 0x07, 0x00, 0x70, 0x55, 0xdd,
+ 0xf6, 0x6f, 0xbb, 0x01, 0x40, 0x28, 0xa1, 0x6f, 0xb6, 0xb7, 0x0f, 0x00,
+ 0x00, 0xde, 0x1f, 0x00, 0x80, 0x88, 0xd8, 0xcc, 0x66, 0xff, 0x03, 0x00,
+ 0x70, 0xf4, 0xf5, 0xdb, 0xaa, 0xee, 0x01, 0x60, 0x28, 0x2d, 0x49, 0xf7,
+ 0xf6, 0x07, 0x00, 0x00, 0x7c, 0x0f, 0x00, 0x08, 0x48, 0x66, 0x6e, 0xfb,
+ 0xef, 0x03, 0x00, 0xd0, 0xd5, 0xdf, 0x52, 0xff, 0xda, 0x03, 0x20, 0xa3,
+ 0xa5, 0xd9, 0xb2, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x20, 0x22,
+ 0x33, 0x37, 0xbf, 0xfd, 0x01, 0x00, 0x70, 0x5f, 0xf7, 0xfe, 0xab, 0x6b,
+ 0x02, 0xa0, 0xa8, 0xb4, 0x6d, 0xdf, 0xf6, 0x07, 0x00, 0x00, 0xf8, 0x01,
+ 0x00, 0x12, 0x33, 0x11, 0xd9, 0xdd, 0xff, 0x01, 0x00, 0x70, 0x75, 0xd5,
+ 0x52, 0xea, 0x8a, 0x03, 0x20, 0x84, 0x36, 0x69, 0xba, 0xdb, 0x07, 0x00,
+ 0x00, 0xf0, 0x01, 0x00, 0x81, 0xc8, 0xcc, 0xdd, 0xed, 0xff, 0x00, 0x00,
+ 0x60, 0xd5, 0xdf, 0xf6, 0xae, 0x6b, 0x03, 0x00, 0xa1, 0xa4, 0x6d, 0xdf,
+ 0xfe, 0x07, 0x00, 0x00, 0x60, 0x00, 0x40, 0x44, 0xc6, 0xcc, 0x64, 0xb7,
+ 0xfd, 0x00, 0x00, 0xe0, 0x55, 0xf7, 0xd6, 0xea, 0xba, 0x07, 0x20, 0x94,
+ 0x94, 0x6d, 0xfb, 0xdb, 0x07, 0x00, 0x00, 0x20, 0x00, 0x20, 0x20, 0x32,
+ 0x76, 0x77, 0xff, 0x7f, 0x00, 0x00, 0x60, 0x7d, 0xd5, 0xb6, 0x3f, 0xaf,
+ 0x06, 0xa0, 0xa4, 0x95, 0x6c, 0x9b, 0xee, 0x07, 0x00, 0x00, 0x18, 0x00,
+ 0x10, 0x92, 0x15, 0x73, 0xbb, 0xd9, 0x3f, 0x00, 0x00, 0xe0, 0xf5, 0xff,
+ 0xf7, 0x6a, 0xa9, 0x06, 0x80, 0xa2, 0xb4, 0x6d, 0xfb, 0xfb, 0x07, 0x00,
+ 0x00, 0x04, 0x00, 0x84, 0x88, 0xc8, 0x99, 0xdd, 0xff, 0x3f, 0x00, 0x00,
+ 0xe0, 0x8b, 0xff, 0x96, 0x6a, 0xb6, 0x0a, 0xa0, 0x94, 0x96, 0x64, 0xdb,
+ 0xee, 0x07, 0x00, 0x00, 0x03, 0x08, 0x20, 0x60, 0x66, 0xec, 0xee, 0xb6,
+ 0x1d, 0x00, 0x00, 0xc0, 0x7e, 0xa5, 0xf4, 0xab, 0x55, 0x0d, 0x20, 0xe7,
+ 0xd4, 0x6d, 0xdb, 0xfb, 0x07, 0x00, 0x80, 0x00, 0x00, 0x09, 0x12, 0x33,
+ 0x67, 0x77, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xfa, 0xff, 0xb7, 0x7a, 0x55,
+ 0x19, 0x90, 0x91, 0xd4, 0x64, 0xdb, 0xee, 0x07, 0x00, 0x40, 0x00, 0x81,
+ 0x04, 0x88, 0x91, 0x3b, 0xbb, 0xfd, 0x0f, 0x00, 0x00, 0xc0, 0xab, 0xbf,
+ 0xed, 0x4e, 0xbb, 0x32, 0x20, 0x94, 0x96, 0x6c, 0xff, 0xfa, 0x03, 0x00,
+ 0x30, 0x40, 0x20, 0x20, 0x64, 0xcc, 0xdc, 0xdd, 0xff, 0x07, 0x00, 0x00,
+ 0xc0, 0xeb, 0xea, 0xfd, 0xd5, 0xaa, 0x2a, 0x20, 0xd7, 0xb0, 0x6d, 0x93,
+ 0xef, 0x07, 0x00, 0x08, 0x00, 0x08, 0x01, 0x23, 0xee, 0xee, 0xee, 0xfb,
+ 0x03, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x2d, 0xdd, 0x6a, 0x49, 0xd0, 0x90,
+ 0x9a, 0x64, 0xdf, 0xea, 0x07, 0x00, 0x03, 0x80, 0x40, 0x8c, 0x98, 0x33,
+ 0xb3, 0xbb, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xa5, 0x7b, 0x6d, 0xa7, 0x56,
+ 0xc5, 0xa0, 0x94, 0x94, 0x6f, 0xd3, 0xbb, 0x07, 0x80, 0x10, 0x0c, 0x12,
+ 0x40, 0xc6, 0xb9, 0xdb, 0xfb, 0xfd, 0x01, 0x00, 0x00, 0x80, 0x97, 0xee,
+ 0xdf, 0xba, 0x54, 0x1a, 0xa1, 0xe5, 0xd2, 0x64, 0x7e, 0xee, 0x07, 0x60,
+ 0x02, 0x80, 0x00, 0x31, 0x62, 0xcc, 0xdc, 0xee, 0x7f, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0xdb, 0xaa, 0xb5, 0x8a, 0x86, 0x98, 0x96, 0x6d, 0x9b,
+ 0xea, 0x07, 0x98, 0x00, 0x22, 0x44, 0x88, 0x39, 0x77, 0x77, 0xff, 0x7f,
+ 0x00, 0x00, 0x00, 0x80, 0x7d, 0x77, 0xba, 0x7b, 0x2d, 0x55, 0x3c, 0xa6,
+ 0xb4, 0x6c, 0xf6, 0xaf, 0x07, 0x07, 0x90, 0x88, 0x20, 0x42, 0x9c, 0xbb,
+ 0xbb, 0xbb, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xbd, 0xbf, 0x55, 0x53,
+ 0xa5, 0xb2, 0xa1, 0xb4, 0xc9, 0x9f, 0xda, 0xcf, 0x28, 0x24, 0x42, 0x08,
+ 0x31, 0xe6, 0xcc, 0xdd, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xef,
+ 0xb7, 0xbd, 0xde, 0x12, 0xd1, 0xac, 0x95, 0x4d, 0xf2, 0x56, 0x9f, 0x88,
+ 0x80, 0x10, 0xc2, 0x9c, 0x73, 0x77, 0xef, 0xfe, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0xbf, 0xfb, 0xed, 0xeb, 0x35, 0x95, 0x72, 0xa2, 0x35, 0xcd, 0xb6,
+ 0xd6, 0x2f, 0x21, 0x24, 0x04, 0x31, 0xc6, 0x98, 0x33, 0xf7, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0xd6, 0x6a, 0x7f, 0x5b, 0xab, 0x2d, 0x28, 0x23,
+ 0x65, 0xd9, 0xb6, 0x55, 0x5f, 0x88, 0x08, 0x43, 0x0c, 0x61, 0xde, 0xdd,
+ 0xfb, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x76, 0xff, 0x4d, 0xd7, 0x4d,
+ 0x4a, 0xa5, 0x29, 0x2d, 0xdb, 0xbe, 0x55, 0x1f, 0x22, 0x42, 0x28, 0xc2,
+ 0x39, 0xe7, 0xee, 0xee, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x7f,
+ 0xfb, 0xb6, 0xb6, 0x95, 0x70, 0x2e, 0xa5, 0xd9, 0x24, 0x5d, 0x5f, 0x8a,
+ 0x28, 0x88, 0x31, 0x9e, 0x39, 0x73, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0xec, 0xb7, 0xdf, 0x6c, 0xb5, 0x65, 0x26, 0xa3, 0x39, 0x9b, 0xfc,
+ 0x85, 0x5d, 0x21, 0x04, 0x63, 0x1c, 0xe6, 0xdd, 0xbd, 0xfb, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0xb8, 0xfa, 0xb6, 0x6f, 0x4d, 0x9a, 0x28, 0x59,
+ 0x4d, 0xd3, 0x2f, 0xf5, 0x3f, 0x8c, 0xd1, 0x18, 0xc6, 0x31, 0xf6, 0xdd,
+ 0xfe, 0xff, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xb9, 0xb6,
+ 0x25, 0xe1, 0x4d, 0x69, 0xba, 0x6c, 0xad, 0x3c, 0x41, 0x14, 0x84, 0xe9,
+ 0x9e, 0x37, 0xf7, 0xff, 0xff, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x70, 0x5d,
+ 0x3d, 0x9f, 0x3d, 0x6d, 0x26, 0x52, 0x59, 0xb6, 0x6d, 0xab, 0x7f, 0x14,
+ 0x82, 0xe1, 0x39, 0xe6, 0xdd, 0xfb, 0xff, 0xbf, 0xff, 0x01, 0x00, 0x00,
+ 0x00, 0xf0, 0xf6, 0x6f, 0x77, 0xcd, 0x92, 0xd0, 0x52, 0x4b, 0xb3, 0x49,
+ 0x0b, 0x3a, 0x41, 0x61, 0x38, 0x9e, 0x73, 0xee, 0xdc, 0xff, 0xff, 0xfd,
+ 0x03, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xd7, 0x65, 0xda, 0x66, 0x63, 0x9d,
+ 0xf2, 0x36, 0x7b, 0x6a, 0x7f, 0x14, 0x18, 0x8e, 0xe7, 0xd9, 0x7b, 0xff,
+ 0xff, 0xef, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xdd, 0xb6,
+ 0xc9, 0x4c, 0x46, 0x9a, 0x64, 0xcb, 0x5b, 0xed, 0x06, 0xc6, 0xe3, 0x71,
+ 0xde, 0xbd, 0xff, 0xff, 0x7f, 0xff, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x7f,
+ 0x7f, 0xff, 0x59, 0x37, 0x75, 0xbb, 0x96, 0x66, 0xdb, 0x56, 0xf7, 0xe0,
+ 0xf2, 0x74, 0x9e, 0x77, 0xef, 0xfd, 0xff, 0xeb, 0xed, 0x03, 0x00, 0x00,
+ 0x00, 0xc0, 0xea, 0xdf, 0xb3, 0xdb, 0xde, 0xc6, 0x81, 0xb0, 0x6c, 0xba,
+ 0xb4, 0xf6, 0x38, 0x18, 0x3c, 0xe7, 0x9c, 0xfb, 0xff, 0x7f, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0x6e, 0x66, 0xd9, 0x99, 0xac,
+ 0xa4, 0xcd, 0x96, 0xa5, 0xea, 0x03, 0xa7, 0xcf, 0x79, 0xef, 0xfd, 0xff,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfd, 0xef, 0xdf,
+ 0x6f, 0xef, 0x72, 0x65, 0xd9, 0xb6, 0xad, 0xe8, 0xc1, 0xe1, 0xf1, 0xbe,
+ 0x7b, 0xef, 0xff, 0xdf, 0x7a, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x5f, 0xdd, 0x9d, 0xac, 0x99, 0x84, 0x29, 0xcd, 0x3c, 0x4f, 0x9d, 0x7d,
+ 0x3c, 0x9e, 0xe7, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0xff, 0x77, 0x7b, 0x33, 0xe7, 0x5a, 0x49, 0x9b, 0x65,
+ 0x59, 0x75, 0x07, 0x97, 0xf7, 0xbb, 0xef, 0xff, 0xff, 0xdb, 0xfe, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0x3f, 0xe7, 0xcf, 0x9c, 0x51,
+ 0x4d, 0xb0, 0x6d, 0x4b, 0xc9, 0xd3, 0xf5, 0x79, 0xfe, 0xfb, 0xff, 0xff,
+ 0xdb, 0xda, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xde,
+ 0xdd, 0xf3, 0x4d, 0x52, 0x36, 0xcb, 0xd2, 0x3a, 0x7e, 0x3c, 0xde, 0xe7,
+ 0xbe, 0xff, 0x7f, 0xda, 0xff, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0xfb, 0xdd, 0x73, 0x8f, 0xa5, 0x9a, 0xe6, 0xd9, 0xb6, 0xe2, 0x4e,
+ 0xc7, 0xf7, 0xfd, 0xff, 0xff, 0xff, 0xf7, 0xf6, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xee, 0x79, 0xb2, 0xb2, 0x2c, 0x9f,
+ 0xb6, 0x54, 0xfe, 0xfb, 0x79, 0xbf, 0xff, 0xff, 0x5f, 0xda, 0xff, 0xfa,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xf7, 0xbf, 0xe7, 0x4b,
+ 0xb4, 0x69, 0xd3, 0x2c, 0x25, 0xbd, 0xbc, 0xcf, 0xf7, 0xfd, 0xff, 0xd7,
+ 0xf6, 0xfe, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xbf, 0x9d,
+ 0xf1, 0x3e, 0x57, 0x25, 0xcb, 0xb6, 0x6d, 0xa9, 0xb5, 0xef, 0xfb, 0xff,
+ 0xff, 0xff, 0xd5, 0xda, 0xd6, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0xff, 0xff, 0xfb, 0xcf, 0xf5, 0x25, 0x65, 0xd9, 0x66, 0x5b, 0x4a, 0xfa,
+ 0xf9, 0x7e, 0xff, 0xff, 0xff, 0xf6, 0xd6, 0xdf, 0xfa, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xef, 0x3e, 0xf7, 0x9f, 0x5b, 0x92, 0x6c,
+ 0xdb, 0x52, 0xe5, 0xbe, 0xdf, 0xff, 0xff, 0xbf, 0x51, 0xda, 0xfa, 0x7f,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7b, 0x9f, 0xe7,
+ 0x4c, 0xb3, 0x4d, 0xd3, 0x54, 0xd9, 0xe7, 0xfb, 0xff, 0xff, 0x5f, 0xdc,
+ 0xfa, 0xdf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f,
+ 0xe7, 0xf9, 0x3a, 0xd3, 0xa6, 0xe9, 0xb6, 0xa5, 0xca, 0xf9, 0xfd, 0xff,
+ 0xff, 0x83, 0x42, 0xd2, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xfd, 0xbf, 0xef, 0x4f, 0xd5, 0x64, 0xdb, 0x26, 0x4d, 0x30,
+ 0x7f, 0xff, 0xff, 0xff, 0x91, 0xda, 0xdb, 0xda, 0xdf, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf, 0xff, 0x7d, 0xbe, 0xb5, 0x6d, 0x97,
+ 0x6d, 0x93, 0x56, 0xdf, 0xff, 0xff, 0x7f, 0x81, 0x4a, 0xda, 0x7f, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xef, 0xeb, 0xbb,
+ 0xa6, 0x4d, 0x73, 0xcd, 0x92, 0xaa, 0xfe, 0xff, 0xff, 0x1f, 0x01, 0x6a,
+ 0x5b, 0xfb, 0xfb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xfd, 0xbf, 0x5f, 0x3b, 0xdb, 0x36, 0xbb, 0x26, 0x4c, 0xf9, 0xff, 0xff,
+ 0x0f, 0xa3, 0x2a, 0xe9, 0x7f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xee, 0xff, 0xff, 0xfe, 0xfe, 0xcc, 0x91, 0xec, 0x93, 0x6d, 0x93,
+ 0xf2, 0xff, 0xff, 0x03, 0x00, 0x6a, 0x6d, 0x6f, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x6f, 0x76, 0xb6, 0xcd,
+ 0x76, 0xc9, 0x2a, 0xe9, 0xff, 0xff, 0x00, 0x02, 0x24, 0xed, 0xf9, 0xed,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xdf, 0xff,
+ 0xd9, 0x66, 0x9b, 0x6c, 0x93, 0x54, 0xc5, 0xff, 0x3f, 0x00, 0x01, 0x95,
+ 0xb5, 0xaf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+ 0xff, 0xff, 0xfd, 0xae, 0x7d, 0xde, 0x6d, 0xf6, 0xa1, 0x8a, 0xff, 0x0f,
+ 0x00, 0x81, 0x90, 0xb4, 0xfd, 0xfd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xcd, 0xb2, 0xdb, 0x2c, 0xcb,
+ 0x54, 0xfe, 0x01, 0x00, 0x01, 0xd2, 0xb6, 0xb7, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x39, 0xdb, 0x76,
+ 0xb3, 0x4b, 0xb6, 0x0a, 0xfe, 0x00, 0x00, 0x01, 0x48, 0xda, 0xfe, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
+ 0xcf, 0xb9, 0x6d, 0xb6, 0xd9, 0xa5, 0x75, 0x1c, 0x00, 0x80, 0x80, 0x20,
+ 0xdb, 0xda, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0xff, 0xff, 0x77, 0x96, 0xd9, 0x26, 0xb3, 0x4d, 0x82, 0x11, 0x00,
+ 0x80, 0x80, 0x24, 0x6d, 0xff, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xbb, 0x67, 0xdb, 0xdd, 0x36, 0xd9,
+ 0x54, 0x60, 0x00, 0xc0, 0x00, 0x92, 0x65, 0x6b, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x4f, 0x7d, 0x96,
+ 0xd9, 0x6c, 0x36, 0xad, 0xc2, 0x00, 0x60, 0x00, 0xc8, 0xb6, 0x6d, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xc8, 0x76, 0xbb, 0xcb, 0x64, 0x52, 0x02, 0x03, 0x10, 0x00, 0x64,
+ 0xda, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0x5f, 0xd7, 0x4d, 0x33, 0x99, 0xdd, 0x96, 0x04, 0x2c,
+ 0x1c, 0x40, 0x22, 0xdb, 0xb6, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xdf, 0xb5, 0xed, 0xe6, 0x36, 0x9b,
+ 0x6c, 0x29, 0xf0, 0x03, 0x00, 0x99, 0x6c, 0xfb, 0xfd, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x35, 0xbb,
+ 0xec, 0x76, 0x33, 0x91, 0x02, 0x00, 0x00, 0x00, 0x64, 0x67, 0xdf, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0xbf, 0x6f, 0x9b, 0x9d, 0xc9, 0xce, 0x36, 0x49, 0x00, 0x00, 0x00, 0x93,
+ 0xb1, 0xdd, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x40, 0xff, 0x6a, 0x76, 0xbb, 0xdd, 0xd9, 0x64, 0x12, 0x01,
+ 0x00, 0x40, 0x98, 0xdd, 0x6d, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x66, 0x73, 0x33, 0xbb,
+ 0x9d, 0x4d, 0x00, 0x00, 0x00, 0x63, 0xe6, 0xf6, 0xff, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0xfd,
+ 0xee, 0xee, 0x36, 0x73, 0x2b, 0x04, 0x00, 0xa0, 0x38, 0x75, 0xbf, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7f, 0xd9, 0xec, 0xce, 0x66, 0x66, 0x66, 0x22, 0x04, 0x00, 0xc6,
+ 0x99, 0xbb, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5e, 0xb3, 0xdb, 0xb9, 0xcd, 0xc9, 0x88, 0x89,
+ 0x00, 0x68, 0x31, 0xee, 0xdd, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbe, 0xbb, 0x9b, 0x3f,
+ 0xbb, 0x33, 0x23, 0x04, 0x00, 0x8c, 0xf3, 0xee, 0xff, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x67,
+ 0x76, 0x77, 0xb2, 0x66, 0xce, 0x0c, 0xd1, 0xd6, 0xe3, 0x79, 0xf7, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xfd, 0xef, 0xe6, 0xee, 0xce, 0x9c, 0x31, 0x16, 0x00, 0x3c,
+ 0x9e, 0xfb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x78, 0x9f, 0xdb, 0xdc, 0x9d, 0x99, 0x33, 0xc6,
+ 0xc1, 0xff, 0x8f, 0xe7, 0xbb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xbd, 0xbb, 0x33,
+ 0x7b, 0xee, 0x18, 0x1e, 0x50, 0xf0, 0xf9, 0xfe, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b,
+ 0xf7, 0x77, 0xf7, 0xe6, 0x9c, 0xe3, 0xf0, 0x4d, 0xff, 0x7c, 0xef, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0xdf, 0x76, 0x7f, 0xcf, 0x9e, 0x73, 0x8f, 0x07, 0xff, 0x0b,
+ 0xdf, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xee, 0xcd, 0xdd, 0x9d, 0x7b, 0xf7, 0x7c,
+ 0x7a, 0x00, 0xf0, 0xe7, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xbf, 0xdd, 0x7b,
+ 0x6b, 0x9e, 0xf3, 0xe1, 0xff, 0xff, 0x7d, 0xff, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee,
+ 0xb7, 0xbb, 0x7b, 0xee, 0x79, 0x8f, 0x0f, 0xfa, 0x2f, 0xff, 0xf7, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0xff, 0x77, 0xef, 0xdd, 0x77, 0x7c, 0xfe, 0x02, 0xe8,
+ 0xcf, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xef, 0xee, 0xdd, 0xb3, 0xcf, 0xf3,
+ 0xf1, 0xff, 0xff, 0xf9, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0xff, 0xbf,
+ 0xef, 0xbe, 0xcf, 0x8f, 0xfe, 0x5f, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xbf, 0xbb, 0xf7, 0xde, 0x79, 0x3e, 0xff, 0x52, 0xd2, 0xdf, 0xff, 0x0f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xef, 0xef, 0xef, 0x3c, 0xef, 0xf9, 0xf8, 0xff, 0xff,
+ 0xf7, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xee, 0xdc, 0xf7, 0xfe, 0xe7,
+ 0x97, 0xfe, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf,
+ 0xef, 0xbf, 0x3e, 0xff, 0xda, 0xf6, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0xbf, 0xf7, 0xfe, 0xf7, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xde, 0xbd, 0xef, 0xfb, 0xd7, 0xff, 0xbf,
+ 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x7d, 0xbf,
+ 0xff, 0xd2, 0xf6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf,
+ 0xef, 0xfb, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0xff, 0xef, 0xbe, 0xf7, 0xef, 0xef, 0xff, 0xff, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xdf, 0xbf, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+ 0xfe, 0xff, 0xfb, 0xf7, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xfd, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
diff --git a/test/extended_color.c b/test/extended_color.c
new file mode 100644
index 0000000..bc52cc4
--- /dev/null
+++ b/test/extended_color.c
@@ -0,0 +1,252 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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: extended_color.c,v 1.15 2020/02/02 23:34:34 tom Exp $
+ */
+
+#include <test.priv.h>
+
+#if USE_EXTENDED_COLOR
+
+#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
+
+#if USE_SP_FUNCS
+static bool opt_s = FALSE;
+#define if_opt_s(a,b) (opt_s ? (a) : (b))
+#else
+#define if_opt_s(a,b) (b)
+#endif
+
+static void
+failed(const char *name)
+{
+ printw("...%s failed", name);
+ getch();
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+static void
+do_pair_content(SCREEN *sp, int pair)
+{
+ int i, f, b;
+
+ (void) sp;
+ i = if_opt_s(extended_pair_content_sp(sp, pair, &f, &b),
+ extended_pair_content(0, &f, &b));
+ if (i != OK)
+ failed("pair_content");
+ printw("pair %d contains (%d,%d)\n", pair, f, b);
+ getch();
+}
+
+static void
+do_init_pair(SCREEN *sp, int pair, int fg, int bg)
+{
+ int i;
+
+ (void) sp;
+ i = if_opt_s(init_extended_pair_sp(sp, pair, fg, bg),
+ init_extended_pair(pair, fg, bg));
+ if (i != OK)
+ failed("init_pair");
+}
+
+static void
+do_init_color(SCREEN *sp, int color, int adjust)
+{
+ int r, g, b;
+ int i;
+
+ (void) sp;
+ i = if_opt_s(extended_color_content_sp(sp, color, &r, &g, &b),
+ extended_color_content(color, &r, &g, &b));
+ if (i != OK)
+ failed("color_content");
+
+ r = (adjust + 1000 + r) % 1000;
+ g = (adjust + 1000 + g) % 1000;
+ b = (adjust + 1000 + b) % 1000;
+
+ i = if_opt_s(init_extended_color_sp(sp, color, r, g, b),
+ init_extended_color(color, r, g, b));
+ if (i != OK)
+ failed("init_color");
+}
+
+static void
+do_color_set(const char *expected, int pair)
+{
+ int i = color_set((short) pair, (void *) &pair);
+ printw("%s (%s)\n", expected, SHOW(i));
+ if (i != OK)
+ failed("color_set");
+ getch();
+}
+
+static void
+show_1_rgb(SCREEN *sp, const char *name, int color, int y, int x)
+{
+ int r, g, b;
+ int i;
+
+ (void) sp;
+ i = if_opt_s(extended_color_content_sp(sp, color, &r, &g, &b),
+ extended_color_content(color, &r, &g, &b));
+ wmove(stdscr, y, x);
+ if (i == OK) {
+ printw("%-8s %3d/%3d/%3d", name, r, g, b);
+ } else {
+ printw("%-8s %s", name, SHOW(i));
+ }
+}
+
+static void
+show_rgb(SCREEN *sp)
+{
+ int y, x;
+ getyx(stdscr, y, x);
+ show_1_rgb(sp, "RED", COLOR_RED, y + 1, x);
+ show_1_rgb(sp, "GREEN", COLOR_GREEN, y + 2, x);
+ show_1_rgb(sp, "BLUE", COLOR_BLUE, y + 3, x);
+ wmove(stdscr, y, x);
+}
+
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: extended_color",
+ "",
+ "Options:",
+ " -s use sp-funcs",
+ NULL
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(tbl); ++n) {
+ fprintf(stderr, "%s\n", tbl[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int i;
+ SCREEN *sp;
+
+ while ((i = getopt(argc, argv, "s")) != -1) {
+ switch (i) {
+#if USE_SP_FUNCS
+ case 's':
+ opt_s = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+
+ slk_init(1);
+ sp = newterm(NULL, stdout, stdin);
+ cbreak();
+ noecho();
+
+ if (!has_colors()) {
+ endwin();
+ fprintf(stderr, "This demo requires a color terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+
+ start_color();
+
+ do_pair_content(sp, 0);
+
+ printw("Initializing pair 1 to red/black\n");
+ do_init_pair(sp, 1, COLOR_RED, COLOR_BLACK);
+ do_color_set("RED/BLACK", 1);
+
+ printw("Initializing pair 2 to white/blue\n");
+ do_init_pair(sp, 2, COLOR_WHITE, COLOR_BLUE);
+ do_color_set("WHITE/BLUE", 2);
+
+ printw("Initializing pair 3 to green/black\n");
+ do_init_pair(sp, 3, COLOR_GREEN, COLOR_BLACK);
+ do_color_set("GREEN/BLACK", 3);
+
+ printw("Resetting colors to pair 0\n");
+ do_color_set("Default Colors", 0);
+
+ printw("Resetting colors to pair 1\n");
+ do_color_set("RED/BLACK", 1);
+
+ printw("Drawing soft-key tabs with pair 2\n");
+ slk_attrset(A_BOLD); /* reverse-video is hard to see */
+ (void) if_opt_s(extended_slk_color_sp(sp, 2),
+ extended_slk_color(2));
+ for (i = 1; i <= 8; ++i) {
+ char temp[80];
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "(SLK-%d)", i);
+ slk_set(i, temp, 0);
+ }
+ slk_touch();
+ slk_noutrefresh();
+
+ i = if_opt_s(can_change_color_sp(sp),
+ can_change_color());
+ if (i) {
+ do_color_set("Default Colors", 0);
+ printw("Press any key to stop...\n");
+ nodelay(stdscr, TRUE);
+ while (getch() == ERR) {
+ show_rgb(sp);
+ do_init_color(sp, COLOR_RED, 1);
+ do_init_color(sp, COLOR_BLUE, -1);
+ napms(50);
+ }
+ printw("...done");
+ nodelay(stdscr, FALSE);
+ getch();
+ }
+
+ endwin();
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the ncurses extended color/pair functions\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/filter.c b/test/filter.c
index ab2d856..1ecf281 100644
--- a/test/filter.c
+++ b/test/filter.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -27,15 +28,10 @@
****************************************************************************/
/*
- * Author: Thomas E. Dickey <dickey@clark.net> 1998
+ * Author: Thomas E. Dickey 1998
+ *
+ * $Id: filter.c,v 1.34 2020/02/02 23:34:34 tom Exp $
*
- * $Id: filter.c,v 1.16 2014/08/09 22:35:51 tom Exp $
- */
-#include <test.priv.h>
-
-#if HAVE_FILTER
-
-/*
* An example of the 'filter()' function in ncurses, this program prompts
* for commands and executes them (like a command shell). It illustrates
* how ncurses can be used to implement programs that are not full-screen.
@@ -46,38 +42,261 @@
* reset_shell_mode() and reset_prog_mode() functions, we could invoke endwin()
* and refresh(), but that does not work any better.
*/
+#include <test.priv.h>
+
+#if HAVE_FILTER
+
+#include <time.h>
static int
-new_command(char *buffer, int length, int underline)
+show_prompt(int underline, bool clocked)
{
- int code;
+ int limit = COLS;
+
+ move(0, 0);
+ attrset(A_NORMAL);
+ clrtoeol();
+ attrset(A_BOLD);
+ addstr("Command: ");
- attron(A_BOLD);
- printw("Command: ");
+ limit -= getcurx(stdscr);
+
+ if (clocked) {
+ if (limit >= 3) {
+ time_t now = time((time_t *) 0);
+ struct tm *my = localtime(&now);
+ char buffer[80];
+ int skip, y, x;
+ int margin;
+
+ _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer)) "%02d:%02d:%02d",
+ my->tm_hour,
+ my->tm_min,
+ my->tm_sec);
+
+ if (limit > 9) {
+ skip = 0;
+ } else if (limit > 6) {
+ skip = 3;
+ } else {
+ skip = 6;
+ }
+ /*
+ * Write the clock message on the right-margin so we can show the
+ * results of resizing the screen.
+ */
+ getyx(stdscr, y, x);
+ margin = (int) strlen(buffer) - skip;
+ limit -= margin;
+ move(0, COLS - margin);
+ addstr(buffer);
+ move(y, x);
+ }
+ }
attron(underline);
- code = getnstr(buffer, length);
- /*
- * If this returns anything except ERR/OK, it would be one of ncurses's
- * extensions. Fill the buffer with something harmless that the shell
- * will execute as a comment.
- */
+ return limit;
+}
+
+static int
+new_command(char *buffer, int length, int underline, bool clocked, bool polled)
+{
+ int code = OK;
+
+ if (polled) {
+ bool done = FALSE;
+ bool first = TRUE;
+ int y = 0, x = 0;
+ int n;
+ int mark = 0;
+ int used = 0;
+ const int gap = 2;
+
+ timeout(20); /* no one types 50CPS... */
+ while (!done) {
+ int limit;
+ int ch = getch();
+
+ buffer[used] = '\0';
+
+ limit = show_prompt(underline, clocked);
+ if (first) {
+ getyx(stdscr, y, x);
+ first = FALSE;
+ } else {
+ int left = 0;
+
+ /*
+ * if the screen is too narrow to show the whole buffer,
+ * shift the editing point left/right as needed.
+ */
+ move(y, x);
+ if ((used + gap) > limit) {
+ while ((mark - left + gap) > limit) {
+ left += limit / 2;
+ }
+ }
+ printw("%.*s", limit, buffer + left);
+ move(y, x + mark - left);
+ }
+
+ switch (ch) {
+ case ERR:
+ continue;
+ case '\004':
+ code = ERR;
+ done = TRUE;
+ break;
+ case KEY_ENTER:
+ case '\n':
+ done = TRUE;
+ break;
+ case KEY_BACKSPACE:
+ case '\b':
+ if (used) {
+ if (mark < used) {
+ /* getnstr does not do this */
+ if (mark > 0) {
+ --mark;
+ for (n = mark; n < used; ++n) {
+ buffer[n] = buffer[n + 1];
+ }
+ } else {
+ flash();
+ }
+ } else {
+ /* getnstr does this */
+ mark = --used;
+ buffer[used] = '\0';
+ }
+ } else {
+ flash();
+ }
+ break;
+ /*
+ * Unlike getnstr, this function can move the cursor into the
+ * middle of the buffer and insert/delete at that point.
+ */
+ case KEY_HOME:
+ mark = 0;
+ break;
+ case KEY_END:
+ mark = used;
+ break;
+ case KEY_LEFT:
+ if (mark > 0) {
+ mark--;
+ } else {
+ flash();
+ }
+ break;
+ case KEY_RIGHT:
+ if (mark < used) {
+ mark++;
+ } else {
+ flash();
+ }
+ break;
#ifdef KEY_EVENT
- if (code == KEY_EVENT)
- strcpy(buffer, "# event!");
+ case KEY_EVENT:
+ continue;
#endif
#ifdef KEY_RESIZE
- if (code == KEY_RESIZE) {
- strcpy(buffer, "# resize!");
- getch();
- }
+ case KEY_RESIZE:
+ /*
+ * Unlike getnstr, this function "knows" what the whole screen
+ * is supposed to look like, and can handle resize events.
+ */
+ continue;
#endif
+ case '\t':
+ ch = ' ';
+ /* FALLTHRU */
+ default:
+ if (ch >= KEY_MIN) {
+ flash();
+ continue;
+ }
+ if (mark < used) {
+ /* getnstr does not do this... */
+ for (n = used + 1; n > mark; --n) {
+ buffer[n] = buffer[n - 1];
+ }
+ buffer[mark] = (char) ch;
+ used++;
+ mark++;
+ } else {
+ /* getnstr does this part */
+ buffer[used] = (char) ch;
+ mark = ++used;
+ }
+ break;
+ }
+ }
+ } else {
+ show_prompt(underline, clocked);
+
+ code = getnstr(buffer, length);
+ /*
+ * If this returns anything except ERR/OK, it would be one of ncurses's
+ * extensions. Fill the buffer with something harmless that the shell
+ * will execute as a comment.
+ */
+#ifdef KEY_EVENT
+ if (code == KEY_EVENT)
+ _nc_STRCPY(buffer, "# event!", length);
+#endif
+#ifdef KEY_RESIZE
+ if (code == KEY_RESIZE) {
+ _nc_STRCPY(buffer, "# resize!", length);
+ getch();
+ }
+#endif
+ }
attroff(underline);
attroff(A_BOLD);
- printw("\n");
+ refresh();
return code;
}
+#ifdef NCURSES_VERSION
+/*
+ * Cancel xterm's alternate-screen mode (from dialog -TD)
+ */
+#define isprivate(s) ((s) != 0 && strstr(s, "\033[?") != 0)
+static void
+cancel_altscreen(void)
+{
+ if (isatty(fileno(stdout))
+ && key_mouse != 0 /* xterm and kindred */
+ && isprivate(enter_ca_mode)
+ && isprivate(exit_ca_mode)) {
+ /*
+ * initscr() or newterm() already wrote enter_ca_mode as a side effect
+ * of initializing the screen. It would be nice to not even do that,
+ * but we do not really have access to the correct copy of the
+ * terminfo description until those functions have been invoked.
+ */
+ (void) refresh();
+ (void) putp(exit_ca_mode);
+ (void) fflush(stdout);
+ /*
+ * Prevent ncurses from switching "back" to the normal screen when
+ * exiting from this program. That would move the cursor to the
+ * original location saved in xterm. Normally curses sets the cursor
+ * position to the first line after the display, but the alternate
+ * screen switching is done after that point.
+ *
+ * Cancelling the strings altogether also works around the buggy
+ * implementation of alternate-screen in rxvt, etc., which clear more
+ * of the display than they should.
+ */
+ enter_ca_mode = 0;
+ exit_ca_mode = 0;
+ }
+}
+#endif
+
static void
usage(void)
{
@@ -86,7 +305,15 @@ usage(void)
"Usage: filter [options]"
,""
,"Options:"
+#ifdef NCURSES_VERSION
+ ," -a suppress xterm alternate-screen by amending smcup/rmcup"
+#endif
+ ," -c show current time on prompt line with \"Command\""
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
," -i use initscr() rather than newterm()"
+ ," -p poll for individual characters rather than using getnstr"
};
unsigned n;
for (n = 0; n < SIZEOF(msg); n++)
@@ -100,15 +327,39 @@ main(int argc, char *argv[])
int ch;
char buffer[80];
int underline;
+#ifdef NCURSES_VERSION
+ bool a_option = FALSE;
+#endif
+ bool c_option = FALSE;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
bool i_option = FALSE;
+ bool p_option = FALSE;
setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "i")) != -1) {
+ while ((ch = getopt(argc, argv, "adcip")) != -1) {
switch (ch) {
+#ifdef NCURSES_VERSION
+ case 'a':
+ a_option = TRUE;
+ break;
+#endif
+ case 'c':
+ c_option = TRUE;
+ break;
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
case 'i':
i_option = TRUE;
break;
+ case 'p':
+ p_option = TRUE;
+ break;
default:
usage();
}
@@ -120,8 +371,16 @@ main(int argc, char *argv[])
if (i_option) {
initscr();
} else {
- (void) newterm((char *) 0, stdout, stdin);
+ if (newterm((char *) 0, stdout, stdin) == 0) {
+ fprintf(stderr, "cannot initialize terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
}
+#ifdef NCURSES_VERSION
+ if (a_option) {
+ cancel_altscreen();
+ }
+#endif
cbreak();
keypad(stdscr, TRUE);
@@ -129,7 +388,7 @@ main(int argc, char *argv[])
int background = COLOR_BLACK;
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() != ERR)
+ if (d_option && (use_default_colors() != ERR))
background = -1;
#endif
init_pair(1, COLOR_CYAN, (short) background);
@@ -138,8 +397,11 @@ main(int argc, char *argv[])
underline = A_UNDERLINE;
}
- while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR
- && strlen(buffer) != 0) {
+ for (;;) {
+ int code = new_command(buffer, sizeof(buffer) - 1,
+ underline, c_option, p_option);
+ if (code == ERR || *buffer == '\0')
+ break;
reset_shell_mode();
printf("\n");
fflush(stdout);
@@ -149,7 +411,7 @@ main(int argc, char *argv[])
erase();
refresh();
}
- printw("done");
+ clear();
refresh();
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/firework.c b/test/firework.c
index 6d35d50..bfeadd7 100644
--- a/test/firework.c
+++ b/test/firework.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: firework.c,v 1.30 2014/08/02 17:24:07 tom Exp $
+ * $Id: firework.c,v 1.37 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -37,8 +38,7 @@ static short my_bg = COLOR_BLACK;
static void
cleanup(void)
{
- curs_set(1);
- endwin();
+ stop_curses();
}
static void
@@ -137,17 +137,54 @@ explode(int row, int col)
showit();
}
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: firework [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors, repeat to use in init_pair"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(
- int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
- int start, end, row, diff, flag = 0, direction;
+ int ch;
+ int start, end;
+ int row, diff;
+ int flag = 0;
+ int direction;
unsigned seed;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
- CATCHALL(onsig);
+ while ((ch = getopt(argc, argv, "d")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ }
+ }
+ if (optind < argc)
+ usage();
- initscr();
+ InitAndCatch(initscr(), onsig);
noecho();
cbreak();
keypad(stdscr, TRUE);
@@ -156,7 +193,7 @@ main(
if (has_colors()) {
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (d_option && (use_default_colors() == OK))
my_bg = -1;
#endif
}
@@ -174,7 +211,7 @@ main(
diff = abs(start - end);
} while (diff < 2 || diff >= LINES - 2);
(void) attrset(AttrArg(0, A_NORMAL));
- for (row = 0; row < diff; row++) {
+ for (row = 1; row < diff; row++) {
MvPrintw(LINES - row, start + (row * direction),
(direction < 0) ? "\\" : "/");
if (flag++) {
diff --git a/test/firstlast.c b/test/firstlast.c
index f5328c7..0a8e5ee 100644
--- a/test/firstlast.c
+++ b/test/firstlast.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-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 *
@@ -29,7 +30,7 @@
* This test was written by Alexander V. Lukyanov to demonstrate difference
* between ncurses 4.1 and SVR4 curses
*
- * $Id: firstlast.c,v 1.7 2010/05/01 19:11:55 tom Exp $
+ * $Id: firstlast.c,v 1.9 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -40,6 +41,11 @@ fill(WINDOW *w, const char *str)
const char *s;
int x0 = -1, y0 = -1;
int x1, y1;
+ int maxx, maxy, limit;
+
+ getmaxyx(w, maxy, maxx);
+ wmove(w, 0, 0);
+ limit = maxy * maxx;
for (;;) {
for (s = str; *s; s++) {
@@ -49,6 +55,16 @@ fill(WINDOW *w, const char *str)
wmove(w, 0, 0);
return;
}
+ /* waddch() should return ERR at the lower-right corner */
+ if (--limit < 0) {
+ beep();
+ if (*str == '?')
+ return;
+ napms(500);
+ wmove(w, maxy - 1, 0);
+ str = "?";
+ limit = maxx + 1;
+ }
x0 = x1;
y0 = y1;
}
diff --git a/test/foldkeys.c b/test/foldkeys.c
index a5e25e3..1a5aac0 100644
--- a/test/foldkeys.c
+++ b/test/foldkeys.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2006-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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey, 2006
*
- * $Id: foldkeys.c,v 1.4 2010/11/14 01:00:53 tom Exp $
+ * $Id: foldkeys.c,v 1.9 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate a method for altering key definitions at runtime.
*
@@ -38,21 +39,11 @@
* merging only for the keys which are defined in the terminal description.
*/
+#define NEED_TIME_H
#include <test.priv.h>
#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#define MY_LOGFILE "demo_foldkeys.log"
#define MY_KEYS (KEY_MAX + 1)
@@ -63,10 +54,10 @@ static void
log_last_line(WINDOW *win)
{
FILE *fp;
- int y, x, n;
- char temp[256];
if ((fp = fopen(MY_LOGFILE, "a")) != 0) {
+ char temp[256];
+ int y, x, n;
int need = sizeof(temp) - 1;
if (need > COLS)
need = COLS;
@@ -155,6 +146,7 @@ demo_foldkeys(void)
int first, second;
char final[2];
char *value;
+ size_t need = 0;
if (info[j].state == 0
&& sscanf(info[j].value,
"\033[%d;%d%c",
@@ -162,8 +154,9 @@ demo_foldkeys(void)
&second,
final) == 3
&& *final != ';'
+ && (need = strlen(info[j].value)) != 0
&& (value = strdup(info[j].value)) != 0) {
- sprintf(value, "\033[%d%c", first, *final);
+ _nc_SPRINTF(value, _nc_SLIMIT(need) "\033[%d%c", first, *final);
for (k = 0; k < info_len; ++k) {
if (info[k].state == 0
&& !strcmp(info[k].value, value)) {
@@ -172,7 +165,7 @@ demo_foldkeys(void)
}
}
if (info[j].state == 0) {
- sprintf(value, "\033O%c", *final);
+ _nc_SPRINTF(value, _nc_SLIMIT(need) "\033O%c", *final);
for (k = 0; k < info_len; ++k) {
if (info[k].state == 0
&& !strcmp(info[k].value, value)) {
@@ -203,13 +196,16 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
int ch;
#if HAVE_GETTIMEOFDAY
- int secs, msecs;
- struct timeval current, previous;
+ struct timeval previous;
#endif
+ if (newterm(0, stdout, stdin) == 0) {
+ fprintf(stderr, "Cannot initialize terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+
unlink(MY_LOGFILE);
- newterm(0, stdout, stdin);
(void) cbreak(); /* take input chars one at a time, no wait for \n */
(void) noecho(); /* don't echo input */
@@ -228,6 +224,9 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
const char *name = keyname(escaped ? (ch - MY_KEYS) : ch);
#if HAVE_GETTIMEOFDAY
+ int secs, msecs;
+ struct timeval current;
+
gettimeofday(&current, 0);
secs = (int) (current.tv_sec - previous.tv_sec);
msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000);
diff --git a/test/form_driver_w.c b/test/form_driver_w.c
index 3e928af..dd7ea68 100644
--- a/test/form_driver_w.c
+++ b/test/form_driver_w.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2013-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -31,15 +32,14 @@
****************************************************************************/
/*
- * $Id: form_driver_w.c,v 1.13 2014/08/02 17:24:55 tom Exp $
+ * $Id: form_driver_w.c,v 1.16 2020/02/02 23:34:34 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)
@@ -48,9 +48,22 @@
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 +74,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 +121,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 +138,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 +156,9 @@ main(void)
/* Un post form and free the memory */
unpost_form(my_form);
free_form(my_form);
- free_field(field[0]);
- free_field(field[1]);
+ for (n = 0; n < NUM_FIELDS; ++n) {
+ free_field(field[n]);
+ }
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/gdc.6 b/test/gdc.6
index ed3a4f1..383aae5 100644
--- a/test/gdc.6
+++ b/test/gdc.6
@@ -1,5 +1,6 @@
.\"***************************************************************************
-.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc. *
+.\" Copyright 2020 Thomas E. Dickey *
+.\" Copyright 1998-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,16 +27,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: gdc.6,v 1.3 2006/04/22 23:02:15 tom Exp $
+.\" $Id: gdc.6,v 1.5 2020/02/02 23:34:34 tom Exp $
.TH GDC 6
.SH NAME
gdc \- grand digital clock (curses)
.SH SYNOPSIS
-.B gdc
-[-n] [
-[-s] [
-.I n
-]
+.B gdc \fP[\fIoptions\fP] [\fIn\fP]
.SH DESCRIPTION
.I Gdc
runs a digital clock made of reverse-video blanks on a terminal screen.
@@ -44,14 +41,20 @@ You can make the clock stop, pause or resume by pressing a ``q'',
``s'' or space, respectively.
.SH OPTIONS
.TP
-.B -n
+.B \-d
+use terminal's default colors for the background.
+.TP
+.B \-n
redirects input to /dev/null, making it ignore the stop/pause commands.
You can still stop it by pressing the interrupt key.
.TP
-.B -s
+.B \-s
makes digits scroll as they change.
When running on a fast display, the program breaks up the scrolling into
subsecond repaints, making the operation appear smooth.
+.TP
+.B \-t \fIhh:mm:ss\fP
+specify starting time (default is ``now'').
.PP
With an optional numeric argument
.I num
@@ -61,4 +64,5 @@ seconds.
Normally it runs "forever" (counting down from 2 billion seconds).
.SH AUTHOR
Amos Shapir, modified for curses by John Lupien.
+.br
Improvements for ncurses by Thomas Dickey.
diff --git a/test/gdc.c b/test/gdc.c
index 04ea1b6..59c95e1 100644
--- a/test/gdc.c
+++ b/test/gdc.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +34,7 @@
* modified 10-18-89 for curses (jrl)
* 10-18-89 added signal handling
*
- * $Id: gdc.c,v 1.42 2014/08/09 22:28:42 tom Exp $
+ * $Id: gdc.c,v 1.54 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -66,7 +67,7 @@ sighndl(int signo)
signal(signo, sighndl);
sigtermed = signo;
if (redirected) {
- endwin();
+ stop_curses();
ExitProgram(EXIT_FAILURE);
}
}
@@ -76,7 +77,7 @@ check_term(void)
{
if (sigtermed) {
(void) standend();
- endwin();
+ stop_curses();
fprintf(stderr, "gdc terminated by signal %d\n", sigtermed);
ExitProgram(EXIT_FAILURE);
}
@@ -86,7 +87,6 @@ static void
drawbox(bool scrolling)
{
chtype bottom[XLENGTH + 1];
- int n;
if (hascolor)
(void) attrset(AttrArg(COLOR_PAIR(PAIR_FRAMES), 0));
@@ -97,6 +97,7 @@ drawbox(bool scrolling)
MvAddCh(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER);
if ((mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH)) != ERR) {
+ int n;
for (n = 0; n < XLENGTH; n++) {
if (!scrolling)
bottom[n] &= ~A_COLOR;
@@ -156,8 +157,11 @@ usage(void)
"Usage: gdc [options] [count]"
,""
,"Options:"
- ," -n redirect input to /dev/null"
- ," -s scroll each number into place, rather than flipping"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -n redirect input to /dev/null"
+ ," -s scroll each number into place, rather than flipping"
," -t hh:mm:ss specify starting time (default is ``now'')"
,""
,"If you specify a count, gdc runs for that number of seconds"
@@ -218,13 +222,19 @@ main(int argc, char *argv[])
bool smooth = FALSE;
bool stages = FALSE;
time_t starts = 0;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
setlocale(LC_ALL, "");
- CATCHALL(sighndl);
-
- while ((k = getopt(argc, argv, "nst:")) != -1) {
+ while ((k = getopt(argc, argv, "dnst:")) != -1) {
switch (k) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
case 'n':
ifp = fopen("/dev/null", "r");
redirected = TRUE;
@@ -242,21 +252,24 @@ main(int argc, char *argv[])
if (optind < argc) {
count = atoi(argv[optind++]);
assert(count >= 0);
+ if (optind < argc)
+ usage();
}
- if (optind < argc)
- usage();
- if (redirected) {
- char *name = getenv("TERM");
- if (name == 0
- || newterm(name, ofp, ifp) == 0) {
- fprintf(stderr, "cannot open terminal\n");
- ExitProgram(EXIT_FAILURE);
+ InitAndCatch({
+ if (redirected) {
+ char *name = getenv("TERM");
+ if (name == 0
+ || newterm(name, ofp, ifp) == 0) {
+ fprintf(stderr, "cannot open terminal\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+ } else {
+ initscr();
}
-
- } else {
- initscr();
}
+ ,sighndl);
+
cbreak();
noecho();
nodelay(stdscr, 1);
@@ -268,7 +281,7 @@ main(int argc, char *argv[])
short bg = COLOR_BLACK;
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (d_option && (use_default_colors() == OK))
bg = -1;
#endif
init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED);
@@ -379,8 +392,12 @@ main(int argc, char *argv[])
}
/* this depends on the detailed format of ctime(3) */
- (void) strncpy(buf, ctime(&now), (size_t) 30);
- (void) strcpy(buf + 10, buf + 19);
+ _nc_STRNCPY(buf, ctime(&now), (size_t) 30);
+ {
+ char *d2 = buf + 10;
+ char *s2 = buf + 19;
+ while ((*d2++ = *s2++) != '\0') ;
+ }
MvAddStr(16, 30, buf);
move(6, 0);
@@ -431,6 +448,6 @@ main(int argc, char *argv[])
}
} while (--count);
(void) standend();
- endwin();
+ stop_curses();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/hanoi.c b/test/hanoi.c
index 7447ae2..8f1792d 100644
--- a/test/hanoi.c
+++ b/test/hanoi.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -41,7 +42,7 @@
*
* Date: 05.Nov.90
*
- * $Id: hanoi.c,v 1.36 2014/08/02 17:24:07 tom Exp $
+ * $Id: hanoi.c,v 1.41 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -89,104 +90,6 @@ static int NTiles = 0;
static int NMoves = 0;
static bool AutoFlag = FALSE;
-static void InitTiles(void);
-static void DisplayTiles(void);
-static void MakeMove(int From, int To);
-static void AutoMove(int From, int To, int Num);
-static void Usage(void);
-static int Solved(int NumTiles);
-static int GetMove(int *From, int *To);
-static int InvalidMove(int From, int To);
-
-int
-main(int argc, char **argv)
-{
- int FromCol, ToCol;
-
- setlocale(LC_ALL, "");
-
- switch (argc) {
- case 1:
- NTiles = DEFAULTTILES;
- break;
- case 2:
- NTiles = atoi(argv[1]);
- if (NTiles > MAXTILES || NTiles < MINTILES) {
- fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
- ExitProgram(EXIT_FAILURE);
- }
- break;
- case 3:
- if (strcmp(argv[2], "a")) {
- Usage();
- ExitProgram(EXIT_FAILURE);
- }
- NTiles = atoi(argv[1]);
- if (NTiles > MAXTILES || NTiles < MINTILES) {
- fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
- ExitProgram(EXIT_FAILURE);
- }
- AutoFlag = TRUE;
- break;
- default:
- Usage();
- ExitProgram(EXIT_FAILURE);
- }
- initscr();
- if (has_colors()) {
- int i;
- short bg = COLOR_BLACK;
- start_color();
-#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
- bg = -1;
-#endif
- for (i = 0; i < 9; i++)
- init_pair((short) (i + 1), bg, TileColour[i]);
- }
- cbreak();
- if (LINES < 24) {
- endwin();
- fprintf(stderr, "Min screen length 24 lines\n");
- ExitProgram(EXIT_FAILURE);
- }
- if (AutoFlag) {
- curs_set(0);
- leaveok(stdscr, TRUE); /* Attempt to remove cursor */
- }
- InitTiles();
- DisplayTiles();
- if (AutoFlag) {
- do {
- noecho();
- AutoMove(0, 2, NTiles);
- } while (!Solved(NTiles));
- sleep(2);
- } else {
- echo();
- for (;;) {
- if (GetMove(&FromCol, &ToCol))
- break;
- if (InvalidMove(FromCol, ToCol)) {
- MvAddStr(STATUSLINE, 0, "Invalid Move !!");
- refresh();
- beep();
- continue;
- }
- MakeMove(FromCol, ToCol);
- if (Solved(NTiles)) {
- MvPrintw(STATUSLINE, 0,
- "Well Done !! You did it in %d moves", NMoves);
- refresh();
- sleep(5);
- break;
- }
- }
- }
- endwin();
- ExitProgram(EXIT_SUCCESS);
-}
-
static int
InvalidMove(int From, int To)
{
@@ -329,9 +232,129 @@ Solved(int NumTiles)
}
static void
-Usage(void)
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: hanoi [options] [[<No Of Tiles>] [a]]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -n NUM set number of tiles (positional param is deprecated)"
+ ," -X solve automatically (positional \"a\" is deprecated)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char **argv)
{
- fprintf(stderr, "Usage: hanoi [<No Of Tiles>] [a]\n");
- fprintf(stderr,
- "The 'a' option causes the tower to be solved automatically\n");
+ int ch, FromCol, ToCol;
+
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
+
+ NTiles = DEFAULTTILES;
+ while ((ch = getopt(argc, argv, "dn:X")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+ case 'n':
+ NTiles = atoi(optarg);
+ break;
+ case 'X':
+ AutoFlag = TRUE;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ setlocale(LC_ALL, "");
+
+ switch (ch = (argc - optind)) {
+ case 2:
+ if (strcmp(argv[optind + 1], "a")) {
+ usage();
+ }
+ AutoFlag = TRUE;
+ /* FALLTHRU */
+ case 1:
+ NTiles = atoi(argv[optind]);
+ /* FALLTHRU */
+ case 0:
+ break;
+ default:
+ usage();
+ }
+
+ if (NTiles > MAXTILES || NTiles < MINTILES) {
+ fprintf(stderr, "Range %d to %d\n", MINTILES, MAXTILES);
+ usage();
+ }
+
+ initscr();
+ if (has_colors()) {
+ int i;
+ short bg = COLOR_BLACK;
+ start_color();
+#if HAVE_USE_DEFAULT_COLORS
+ if (d_option && (use_default_colors() == OK))
+ bg = -1;
+#endif
+ for (i = 0; i < 9; i++)
+ init_pair((short) (i + 1), bg, TileColour[i]);
+ }
+ cbreak();
+ if (LINES < 24) {
+ endwin();
+ fprintf(stderr, "Min screen length 24 lines\n");
+ ExitProgram(EXIT_FAILURE);
+ }
+ if (AutoFlag) {
+ curs_set(0);
+ leaveok(stdscr, TRUE); /* Attempt to remove cursor */
+ }
+ InitTiles();
+ DisplayTiles();
+ if (AutoFlag) {
+ do {
+ noecho();
+ AutoMove(0, 2, NTiles);
+ } while (!Solved(NTiles));
+ sleep(2);
+ } else {
+ echo();
+ for (;;) {
+ if (GetMove(&FromCol, &ToCol))
+ break;
+ if (InvalidMove(FromCol, ToCol)) {
+ MvAddStr(STATUSLINE, 0, "Invalid Move !!");
+ refresh();
+ beep();
+ continue;
+ }
+ MakeMove(FromCol, ToCol);
+ if (Solved(NTiles)) {
+ MvPrintw(STATUSLINE, 0,
+ "Well Done !! You did it in %d moves", NMoves);
+ refresh();
+ sleep(5);
+ break;
+ }
+ }
+ }
+ stop_curses();
+ ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/hashtest.c b/test/hashtest.c
index 8499221..70d6228 100644
--- a/test/hashtest.c
+++ b/test/hashtest.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +31,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.36 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -82,7 +83,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 +91,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);
@@ -222,12 +223,10 @@ main(int argc, char *argv[])
test_optimize = TRUE;
}
#if USE_TRACE
- trace(TRACE_TIMES);
+ curses_trace(TRACE_TIMES);
#endif
- CATCHALL(finish); /* arrange interrupts to terminate */
-
- (void) initscr(); /* initialize the curses library */
+ InitAndCatch(initscr(), finish);
keypad(stdscr, TRUE); /* enable keyboard mapping */
(void) nonl(); /* tell curses not to do NL->CR/NL on output */
(void) cbreak(); /* take input chars one at a time, no wait for \n */
diff --git a/test/inch_wide.c b/test/inch_wide.c
index 3d31f17..e44a5f5 100644
--- a/test/inch_wide.c
+++ b/test/inch_wide.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $
+ * $Id: inch_wide.c,v 1.11 2020/02/02 23:34:34 tom Exp $
*/
/*
int in_wch(cchar_t *wcval);
@@ -44,6 +45,7 @@
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if USE_WIDEC_SUPPORT
@@ -59,13 +61,24 @@ 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",
+ " for next input file",
+ 0
+ };
+
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
int j;
int txt_x = 0, txt_y = 0;
int base_y;
- int limit;
cchar_t ch;
cchar_t text[MAX_COLS];
@@ -109,6 +122,8 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
}
while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) {
+ int limit;
+
switch (j) {
case KEY_DOWN:
case 'j':
@@ -148,6 +163,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;
@@ -251,7 +269,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
if (argc < 2) {
- fprintf(stderr, "usage: %s file\n", argv[0]);
+ fprintf(stderr, "usage: %s file1 [file2 [...]]\n", argv[0]);
return EXIT_FAILURE;
}
diff --git a/test/inchs.c b/test/inchs.c
index be3aab8..1d1691a 100644
--- a/test/inchs.c
+++ b/test/inchs.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: inchs.c,v 1.12 2012/11/18 01:58:15 tom Exp $
+ * $Id: inchs.c,v 1.18 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*/
@@ -46,6 +47,7 @@
*/
#include <test.priv.h>
+#include <popup_msg.h>
#define BASE_Y 7
#define MAX_COLS 1024
@@ -69,13 +71,23 @@ 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",
+ " for next input file",
+ 0
+ };
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
int ch, j;
int txt_x = 0, txt_y = 0;
int base_y;
- int limit;
chtype text[MAX_COLS];
if (argv[level] == 0) {
@@ -120,6 +132,8 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
}
while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) {
+ int limit;
+
switch (j) {
case KEY_DOWN:
case 'j':
@@ -159,6 +173,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;
@@ -264,7 +281,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
if (argc < 2) {
- fprintf(stderr, "usage: %s file\n", argv[0]);
+ fprintf(stderr, "usage: %s file1 [file2 [...]]\n", argv[0]);
return EXIT_FAILURE;
}
diff --git a/test/ins_wide.c b/test/ins_wide.c
index 8e7c123..9f73392 100644
--- a/test/ins_wide.c
+++ b/test/ins_wide.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2002-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2002-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: ins_wide.c,v 1.21 2014/08/02 17:24:55 tom Exp $
+ * $Id: ins_wide.c,v 1.25 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the wins_wstr() and wins_wch functions.
* Thomas Dickey - 2002/11/23
@@ -236,7 +237,8 @@ test_inserts(int level)
static char cmd[80];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -390,6 +392,8 @@ test_inserts(int level)
}
break;
default:
+ if (length >= BUFSIZ - 2)
+ break;
buffer[length++] = (wchar_t) ch;
buffer[length] = '\0';
@@ -455,7 +459,7 @@ usage(void)
{
static const char *tbl[] =
{
- "Usage: inserts [options]"
+ "Usage: ins_wide [options]"
,""
,"Options:"
," -f FILE read data from given file"
diff --git a/test/insdelln.c b/test/insdelln.c
index 34fb388..55e606a 100644
--- a/test/insdelln.c
+++ b/test/insdelln.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2008-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,13 +27,17 @@
* authorization. *
****************************************************************************/
/*
- * $Id: insdelln.c,v 1.9 2014/08/02 23:09:32 tom Exp $
+ * $Id: insdelln.c,v 1.14 2020/02/02 23:34:34 tom Exp $
*
* test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
*/
#include <test.priv.h>
+#if HAVE_WINSDELLN
+
+#include <popup_msg.h>
+
#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
#define COLOR_DEFAULT (-1)
@@ -66,10 +71,10 @@ color_params(unsigned state, int *pair)
};
/* *INDENT-ON* */
- static bool first = TRUE;
const char *result = 0;
if (has_colors()) {
+ static bool first = TRUE;
if (first) {
unsigned n;
@@ -217,19 +222,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 +275,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)) {
@@ -387,3 +383,12 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
ExitProgram(EXIT_SUCCESS);
}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the curses winsdelln function\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/inserts.c b/test/inserts.c
index ae38fa2..6d108cc 100644
--- a/test/inserts.c
+++ b/test/inserts.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2002-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2002-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: inserts.c,v 1.27 2012/12/16 00:35:27 tom Exp $
+ * $Id: inserts.c,v 1.30 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the winsstr() and winsch functions.
* Thomas Dickey - 2002/10/19
@@ -161,7 +162,8 @@ test_inserts(int level)
static char cmd[80];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -319,6 +321,8 @@ test_inserts(int level)
beep();
break;
}
+ if (length >= BUFSIZ - 2)
+ break;
buffer[length++] = (char) ch;
buffer[length] = '\0';
diff --git a/test/key_names.c b/test/key_names.c
index 579f02f..69c95d6 100644
--- a/test/key_names.c
+++ b/test/key_names.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2007-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: key_names.c,v 1.5 2014/08/02 17:24:55 tom Exp $
+ * $Id: key_names.c,v 1.8 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -77,7 +78,8 @@ main(int argc, char *argv[])
endwin();
}
for (n = -1; n < KEY_MAX + 512; n++) {
- const char *result = key_name((wchar_t) n);
+ int check = wcwidth((wchar_t) n);
+ const char *result = check >= 0 ? key_name((wchar_t) n) : "?";
if (result != 0)
printf("%d(%5o):%s\n", n, n, result);
}
diff --git a/test/keynames.c b/test/keynames.c
index 26cfa87..5a3d12a 100644
--- a/test/keynames.c
+++ b/test/keynames.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-2006,2008 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: keynames.c,v 1.9 2008/10/11 20:22:37 tom Exp $
+ * $Id: keynames.c,v 1.10 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
diff --git a/test/knight.c b/test/knight.c
index ae9d223..bda7da3 100644
--- a/test/knight.c
+++ b/test/knight.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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,25 +34,26 @@
* 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.47 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
/* board size */
-#define BDEPTH 8
-#define BWIDTH 8
+#define YLIMIT 8
+#define XLIMIT 8
+#define MAXMOVES (ylimit * xlimit)
/* where to start the instructions */
-#define INSTRY 2
-#define INSTRX 35
+#define INSTRY 2
+#define INSTRX 35
/* corner of board */
-#define BOARDY 2
-#define BOARDX 0
+#define BOARDY 2
+#define BOARDX 0
/* notification line */
-#define NOTIFYY 21
+#define NOTIFYY 21
/* virtual color values */
#define TRAIL_COLOR 1
@@ -65,20 +67,30 @@
#define CYINV(y) (((y) - 2) / 2)
typedef struct {
- short x, y;
-} cell;
+ int x, y;
+} HISTORY;
+
+typedef int SQUARES[YLIMIT][XLIMIT];
static WINDOW *boardwin; /* the board window */
static WINDOW *helpwin; /* the help window */
static WINDOW *msgwin; /* the message window */
-static cell history[BDEPTH * BWIDTH + 1]; /* choice history */
+
+#if HAVE_USE_DEFAULT_COLORS
+static bool d_option;
+#endif
+
static chtype minus = '-'; /* possible-move character */
static chtype oldch;
static chtype plus = '+'; /* cursor hot-spot character */
static chtype trail = '#'; /* trail character */
-static int movecount; /* count of moves so far */
-static int trialcount; /* count of trials so far */
-static short board[BDEPTH][BWIDTH]; /* the squares */
+
+static int ylimit = YLIMIT;
+static int xlimit = XLIMIT;
+static int maxmoves = (YLIMIT * XLIMIT);
+
+static int count_tries; /* count of trials so far */
+static int test_test; /* FIXME */
/* *INDENT-OFF* */
static const struct {
int y;
@@ -93,6 +105,7 @@ static const struct {
{ 1, -2 },
{ 2, -1 },
};
+#define MAX_OFFSET (unsigned)SIZEOF(offsets)
/* *INDENT-ON* */
static void
@@ -104,9 +117,12 @@ init_program(void)
initscr();
cbreak(); /* immediate char return */
noecho(); /* no immediate echo */
- boardwin = newwin(BDEPTH * 2 + 1, BWIDTH * 4 + 1, BOARDY, BOARDX);
+
+ maxmoves = MAXMOVES;
+ boardwin = newwin(ylimit * 2 + 1, xlimit * 4 + 1, BOARDY, BOARDX);
helpwin = newwin(0, 0, INSTRY, INSTRX);
msgwin = newwin(1, INSTRX - 1, NOTIFYY, 0);
+
scrollok(msgwin, TRUE);
keypad(boardwin, TRUE);
@@ -115,7 +131,7 @@ init_program(void)
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (d_option && (use_default_colors() == OK))
bg = -1;
#endif
@@ -178,7 +194,11 @@ help2(void)
(void) waddstr(helpwin, "r -- redraw screen \\|/ \\|/ \n");
(void) waddstr(helpwin, "bksp -- undo move h-+-l 4-+-6\n");
(void) waddstr(helpwin, "a -- autojump /|\\ /|\\ \n");
- (void) waddstr(helpwin, " b j n 1 2 3\n");
+ if (ylimit <= 6) {
+ (void) waddstr(helpwin, "R -- solve (slow) b j n 1 2 3\n");
+ } else {
+ (void) waddstr(helpwin, " b j n 1 2 3\n");
+ }
(void) waddstr(helpwin, "\nYou can place your knight on the selected\n");
(void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n");
@@ -202,30 +222,33 @@ show_help(bool * keyhelp)
wrefresh(helpwin);
}
-static bool
-chksqr(int r1, int c1)
+static inline bool
+isValidYX(int y, int x)
{
- if ((r1 < 0) || (r1 > BDEPTH - 1))
- return (FALSE);
- if ((c1 < 0) || (c1 > BWIDTH - 1))
- return (FALSE);
- return ((!board[r1][c1]) ? TRUE : FALSE);
+ return (y >= 0 && y < ylimit && x >= 0 && x < xlimit) ? TRUE : FALSE;
+}
+
+static inline bool
+isUnusedYX(SQUARES squares, int y, int x)
+{
+ return (isValidYX(y, x) && (!squares[y][x]) ? TRUE : FALSE);
}
static bool
-chkmoves(int rw, int col)
-/* check to see if valid moves are available */
+boardIsFilled(SQUARES squares, int y, int x)
{
unsigned n;
- for (n = 0; n < SIZEOF(offsets); n++)
- if (chksqr(rw + offsets[n].y, col + offsets[n].x))
- return (TRUE);
- return (FALSE);
+ for (n = 0; n < MAX_OFFSET; n++) {
+ if (isUnusedYX(squares, y + offsets[n].y, x + offsets[n].x)) {
+ return FALSE;
+ }
+ }
+ return TRUE;
}
static void
-dosquares(void)
+drawBoard(void)
{
int i, j;
@@ -233,7 +256,7 @@ dosquares(void)
move(BOARDY, BOARDX);
waddch(boardwin, ACS_ULCORNER);
- for (j = 0; j < 7; j++) {
+ for (j = 0; j < (ylimit - 1); j++) {
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
@@ -244,10 +267,10 @@ dosquares(void)
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_URCORNER);
- for (i = 1; i < BDEPTH; i++) {
+ for (i = 1; i < ylimit; i++) {
move(BOARDY + i * 2 - 1, BOARDX);
waddch(boardwin, ACS_VLINE);
- for (j = 0; j < BWIDTH; j++) {
+ for (j = 0; j < xlimit; j++) {
waddch(boardwin, ' ');
waddch(boardwin, ' ');
waddch(boardwin, ' ');
@@ -255,7 +278,7 @@ dosquares(void)
}
move(BOARDY + i * 2, BOARDX);
waddch(boardwin, ACS_LTEE);
- for (j = 0; j < BWIDTH - 1; j++) {
+ for (j = 0; j < xlimit - 1; j++) {
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
@@ -269,7 +292,7 @@ dosquares(void)
move(BOARDY + i * 2 - 1, BOARDX);
waddch(boardwin, ACS_VLINE);
- for (j = 0; j < BWIDTH; j++) {
+ for (j = 0; j < xlimit; j++) {
waddch(boardwin, ' ');
waddch(boardwin, ' ');
waddch(boardwin, ' ');
@@ -278,7 +301,7 @@ dosquares(void)
move(BOARDY + i * 2, BOARDX);
waddch(boardwin, ACS_LLCORNER);
- for (j = 0; j < BWIDTH - 1; j++) {
+ for (j = 0; j < xlimit - 1; j++) {
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
waddch(boardwin, ACS_HLINE);
@@ -291,37 +314,36 @@ dosquares(void)
}
static void
-mark_possibles(int prow, int pcol, chtype mark)
+mark_possibles(SQUARES squares, int y, int x, chtype mark)
{
unsigned n;
- for (n = 0; n < SIZEOF(offsets); n++) {
- if (chksqr(prow + offsets[n].y, pcol + offsets[n].x)) {
- cellmove(prow + offsets[n].y, pcol + offsets[n].x);
+ for (n = 0; n < MAX_OFFSET; n++) {
+ if (isUnusedYX(squares, y + offsets[n].y, x + offsets[n].x)) {
+ cellmove(y + offsets[n].y, x + offsets[n].x);
waddch(boardwin, mark);
}
}
}
static bool
-find_next_move(int *y, int *x)
+find_next_move(SQUARES squares, HISTORY * doneData, int doneSize, int *y, int *x)
{
- unsigned j, k;
- int found = -1;
- int first = -1;
- int next = -1;
- int oldy, oldx;
- int newy, newx;
bool result = FALSE;
- if (movecount > 1) {
- oldy = history[movecount - 1].y;
- oldx = history[movecount - 1].x;
- for (j = 0; j < SIZEOF(offsets) * 2; j++) {
- k = j % SIZEOF(offsets);
- newy = oldy + offsets[k].y;
- newx = oldx + offsets[k].x;
- if (chksqr(newy, newx)) {
+ if (doneSize > 1) {
+ unsigned j;
+ int oldy = doneData[doneSize - 1].y;
+ int oldx = doneData[doneSize - 1].x;
+ int found = -1;
+ int first = -1;
+ int next = -1;
+
+ for (j = 0; j < MAX_OFFSET * 2; j++) {
+ unsigned k = j % MAX_OFFSET;
+ int newy = oldy + offsets[k].y;
+ int newx = oldx + offsets[k].x;
+ if (isUnusedYX(squares, newy, newx)) {
if (first < 0)
first = (int) k;
if (newy == *y
@@ -345,16 +367,16 @@ find_next_move(int *y, int *x)
}
static void
-count_next_moves(int y, int x)
+count_next_moves(SQUARES squares, int count_moves, int y, int x)
{
int count = 0;
unsigned j;
- wprintw(msgwin, "\nMove %d", movecount);
- for (j = 0; j < SIZEOF(offsets); j++) {
+ wprintw(msgwin, "\nMove %d", count_moves);
+ for (j = 0; j < MAX_OFFSET; j++) {
int newy = y + offsets[j].y;
int newx = x + offsets[j].x;
- if (chksqr(newy, newx)) {
+ if (isUnusedYX(squares, newy, newx)) {
++count;
}
}
@@ -383,37 +405,38 @@ markcell(chtype tchar, int row, int column)
}
static void
-drawmove(chtype tchar, int oldy, int oldx, int row, int column)
+drawMove(SQUARES squares, int count_moves, chtype tchar, int oldy, int oldx, int
+ row, int column)
/* place the stars, update board & currents */
{
- if (movecount <= 1) {
+ if (count_moves <= 1) {
int i, j;
- for (i = 0; i < BDEPTH; i++) {
- for (j = 0; j < BWIDTH; j++) {
- if (movecount == 0) {
+ for (i = 0; i < ylimit; i++) {
+ for (j = 0; j < xlimit; j++) {
+ if (count_moves == 0) {
unmarkcell(i, j);
} else {
cellmove(i, j);
if (winch(boardwin) == minus)
- waddch(boardwin, movecount ? ' ' : minus);
+ waddch(boardwin, ' ');
}
}
}
} else {
markcell(tchar, oldy, oldx);
- mark_possibles(oldy, oldx, ' ');
+ mark_possibles(squares, oldy, oldx, ' ');
}
if (row >= 0 && column >= 0) {
markcell(trail, row, column);
- mark_possibles(row, column, minus);
- board[row][column] = TRUE;
+ mark_possibles(squares, row, column, minus);
+ squares[row][column] = TRUE;
}
- wprintw(msgwin, "\nMove %d", movecount);
- if (trialcount != movecount)
- wprintw(msgwin, " (%d tries)", trialcount);
+ wprintw(msgwin, "\nMove %d", count_moves);
+ if (count_tries != count_moves)
+ wprintw(msgwin, " (%d tries)", count_tries);
wclrtoeol(msgwin);
}
@@ -427,17 +450,16 @@ iabs(int num)
}
static bool
-evalmove(int row, int column)
-/* evaluate move */
+evaluate_move(SQUARES squares, HISTORY * doneData, int doneSize, int row, int column)
{
- if (movecount == 1)
+ if (doneSize <= 1)
return (TRUE);
- else if (board[row][column] == TRUE) {
+ else if (squares[row][column] == TRUE) {
waddstr(msgwin, "\nYou've already been there.");
return (FALSE);
} else {
- int rdif = iabs(row - history[movecount - 1].y);
- int cdif = iabs(column - history[movecount - 1].x);
+ int rdif = iabs(row - doneData[doneSize - 1].y);
+ int cdif = iabs(column - doneData[doneSize - 1].x);
if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) {
waddstr(msgwin, "\nThat's not a legal knight's move.");
@@ -449,15 +471,18 @@ evalmove(int row, int column)
}
static int
-completed(void)
+completed(SQUARES squares)
{
int i, j, count = 0;
- for (i = 0; i < BDEPTH; i++)
- for (j = 0; j < BWIDTH; j++)
- if (board[i][j] != 0)
+ for (i = 0; i < ylimit; i++) {
+ for (j = 0; j < xlimit; j++) {
+ if (squares[i][j] != 0) {
count += 1;
- return (count == (BWIDTH * BDEPTH) ? -1 : count);
+ }
+ }
+ }
+ return ((count == maxmoves) ? -1 : count);
}
static void
@@ -467,6 +492,103 @@ no_previous_move(void)
beep();
}
+/* Recursively try all possible moves, starting from (y,x) */
+static int
+recurBack(SQUARES squares, int y, int x, int total)
+{
+ int longest = total;
+ int best_x = x;
+ int best_y = y;
+ int result;
+
+ if (total < maxmoves) {
+ unsigned k;
+
+ for (k = 0; k < MAX_OFFSET; k++) {
+ int try_x = x + offsets[k].x;
+ int try_y = y + offsets[k].y;
+ if (isUnusedYX(squares, try_y, try_x)) {
+ ++test_test;
+ squares[try_y][try_x] = total + 1;
+ result = recurBack(squares, try_y, try_x, total + 1);
+ if (result > longest) {
+ longest = result;
+ best_x = try_x;
+ best_y = try_y;
+ }
+ if (result >= maxmoves)
+ break;
+ squares[try_y][try_x] = 0; /* allow retry... */
+ }
+ }
+ }
+
+ result = total;
+ if (longest > total) {
+ result = longest;
+ squares[best_y][best_x] = total + 1;
+ (void) recurBack(squares, best_y, best_x, total + 1);
+ if (result < maxmoves)
+ squares[best_y][best_x] = 0;
+ }
+
+ return result;
+}
+
+/*
+ * Solve the Knight Tour problem using backtracking, returning the length of
+ * the resulting solution. If this is invoked from a point where the remaining
+ * choices cannot complete the tour, the result will fall short.
+ */
+static int
+useBacktracking(SQUARES result, HISTORY * doneData, int doneSize)
+{
+ int y = 0, x = 0, n;
+ SQUARES squares;
+ int total;
+ int actual = doneSize - 1;
+
+ memset(squares, 0, sizeof(squares));
+ for (n = 1; n <= actual; ++n) {
+ y = doneData[n].y;
+ x = doneData[n].x;
+ squares[y][x] = n;
+ }
+
+ total = recurBack(squares, y, x, actual);
+ if (total > actual) {
+ for (y = 0; y < ylimit; ++y) {
+ for (x = 0; x < xlimit; ++x) {
+ result[y][x] = squares[y][x];
+ if ((n = squares[y][x]) != 0) {
+ doneData[n].y = y;
+ doneData[n].x = x;
+ }
+ }
+ }
+ }
+ return total;
+}
+
+static int
+reviewHistory(HISTORY * history, int count_moves, int review, int *ny, int *nx)
+{
+ if (review < 0) {
+ beep();
+ review = 0;
+ } else if (review > count_moves - 2) {
+ beep();
+ review = count_moves - 2;
+ } else {
+ *ny = history[count_moves - review - 1].y;
+ *nx = history[count_moves - review - 1].x;
+ wprintw(msgwin, "\nReview %d:%d.", count_moves - review - 1,
+ count_moves - 1);
+ wrefresh(msgwin);
+ }
+ return review;
+}
+
static void
play(void)
/* play the game */
@@ -477,14 +599,19 @@ play(void)
int lastrow = 0;
int ny = 0, nx = 0;
int review = 0; /* review history */
+ int test_size;
int rw = 0, col = 0; /* current row and column */
do {
+ SQUARES squares;
+ HISTORY history[(YLIMIT * XLIMIT) + 1];
+ int count_moves = 0; /* count of moves so far */
+
/* clear screen and draw board */
werase(boardwin);
werase(helpwin);
werase(msgwin);
- dosquares();
+ drawBoard();
help1();
wnoutrefresh(stdscr);
wnoutrefresh(helpwin);
@@ -492,10 +619,9 @@ play(void)
wnoutrefresh(boardwin);
doupdate();
- movecount = 0;
- for (i = 0; i < BDEPTH; i++) {
- for (j = 0; j < BWIDTH; j++) {
- board[i][j] = FALSE;
+ for (i = 0; i < ylimit; i++) {
+ for (j = 0; j < xlimit; j++) {
+ squares[i][j] = FALSE;
unmarkcell(i, j);
}
}
@@ -503,8 +629,8 @@ play(void)
history[0].y = history[0].x = -1;
history[1].y = history[1].x = -1;
lastrow = lastcol = -2;
- movecount = 1;
- trialcount = 1;
+ count_moves = 1;
+ count_tries = 1;
keyhelp = FALSE;
show_help(&keyhelp);
@@ -512,7 +638,7 @@ play(void)
if (rw != lastrow || col != lastcol) {
if (lastrow >= 0 && lastcol >= 0) {
cellmove(lastrow, lastcol);
- if (board[lastrow][lastcol])
+ if (squares[lastrow][lastcol])
waddch(boardwin, trail);
else
waddch(boardwin, oldch);
@@ -534,7 +660,7 @@ play(void)
case 'k':
case '8':
case KEY_UP:
- ny = rw + BDEPTH - 1;
+ ny = rw + ylimit - 1;
nx = col;
break;
case 'j':
@@ -547,7 +673,7 @@ play(void)
case '4':
case KEY_LEFT:
ny = rw;
- nx = col + BWIDTH - 1;
+ nx = col + xlimit - 1;
break;
case 'l':
case '6':
@@ -558,19 +684,19 @@ play(void)
case 'y':
case '7':
case KEY_A1:
- ny = rw + BDEPTH - 1;
- nx = col + BWIDTH - 1;
+ ny = rw + ylimit - 1;
+ nx = col + xlimit - 1;
break;
case 'b':
case '1':
case KEY_C1:
ny = rw + 1;
- nx = col + BWIDTH - 1;
+ nx = col + xlimit - 1;
break;
case 'u':
case '9':
case KEY_A3:
- ny = rw + BDEPTH - 1;
+ ny = rw + ylimit - 1;
nx = col + 1;
break;
case 'n':
@@ -587,8 +713,8 @@ play(void)
MEVENT myevent;
getmouse(&myevent);
- if (myevent.y >= CY(0) && myevent.y <= CY(BDEPTH)
- && myevent.x >= CX(0) && myevent.x <= CX(BWIDTH)) {
+ if (myevent.y >= CY(0) && myevent.y <= CY(ylimit)
+ && myevent.x >= CX(0) && myevent.x <= CX(xlimit)) {
nx = CXINV(myevent.x);
ny = CYINV(myevent.y);
ungetch('\n');
@@ -605,8 +731,8 @@ play(void)
request_mouse_pos();
test_y = MOUSE_Y_POS + 0;
test_x = MOUSE_X_POS + 1;
- if (test_y >= CY(0) && test_y <= CY(BDEPTH)
- && test_x >= CX(0) && test_x <= CX(BWIDTH)) {
+ if (test_y >= CY(0) && test_y <= CY(ylimit)
+ && test_x >= CX(0) && test_x <= CX(xlimit)) {
ny = CYINV(test_y);
nx = CXINV(test_x);
wmove(helpwin, 0, 0);
@@ -622,18 +748,20 @@ play(void)
case '\n':
case ' ':
review = 0;
- if (evalmove(rw, col)) {
- drawmove(trail,
- history[movecount - 1].y,
- history[movecount - 1].x,
+ if (evaluate_move(squares, history, count_moves, rw, col)) {
+ drawMove(squares,
+ count_moves,
+ trail,
+ history[count_moves - 1].y,
+ history[count_moves - 1].x,
rw, col);
- history[movecount].y = (short) rw;
- history[movecount].x = (short) col;
- movecount++;
- trialcount++;
+ history[count_moves].y = (short) rw;
+ history[count_moves].x = (short) col;
+ count_moves++;
+ count_tries++;
- if (!chkmoves(rw, col)) {
- if (completed() < 0) {
+ if (boardIsFilled(squares, rw, col)) {
+ if (completed(squares) < 0) {
waddstr(msgwin, "\nYou won.");
} else {
waddstr(msgwin,
@@ -649,40 +777,40 @@ play(void)
case KEY_BACKSPACE:
case '\b':
review = 0;
- if (movecount <= 0) {
+ if (count_moves <= 0) {
no_previous_move();
- } else if (movecount <= 1) {
- ny = history[movecount].y;
- nx = history[movecount].x;
+ } else if (count_moves <= 1) {
+ ny = history[count_moves].y;
+ nx = history[count_moves].x;
if (nx < 0 || ny < 0) {
ny = (lastrow >= 0) ? lastrow : 0;
nx = (lastcol >= 0) ? lastcol : 0;
}
- movecount = 0;
- board[ny][nx] = FALSE;
+ count_moves = 0;
+ squares[ny][nx] = FALSE;
oldch = minus;
- drawmove(' ', ny, nx, -1, -1);
- movecount = 1;
- trialcount = 1;
+ drawMove(squares, count_moves, ' ', ny, nx, -1, -1);
+ count_moves = 1;
+ count_tries = 1;
no_previous_move();
} else {
- int oldy = history[movecount - 1].y;
- int oldx = history[movecount - 1].x;
+ int oldy = history[count_moves - 1].y;
+ int oldx = history[count_moves - 1].x;
- if (!board[rw][col]) {
+ if (!squares[rw][col]) {
cellmove(rw, col);
waddch(boardwin, ' ');
}
- board[oldy][oldx] = FALSE;
- --movecount;
- ny = history[movecount - 1].y;
- nx = history[movecount - 1].x;
+ squares[oldy][oldx] = FALSE;
+ --count_moves;
+ ny = history[count_moves - 1].y;
+ nx = history[count_moves - 1].x;
if (nx < 0 || ny < 0) {
ny = oldy;
nx = oldx;
}
- drawmove(' ', oldy, oldx, ny, nx);
+ drawMove(squares, count_moves, ' ', oldy, oldx, ny, nx);
/* avoid problems if we just changed the current cell */
cellmove(lastrow, lastcol);
@@ -693,32 +821,44 @@ play(void)
case 'a':
nx = col;
ny = rw;
- if (find_next_move(&ny, &nx))
- count_next_moves(ny, nx);
+ if (find_next_move(squares, history, count_moves, &ny, &nx))
+ count_next_moves(squares, count_moves, ny, nx);
else
beep();
break;
case 'F':
- if (review > 0) {
- review--;
- ny = history[movecount - review - 1].y;
- nx = history[movecount - review - 1].x;
- } else {
- beep();
- }
+ review = reviewHistory(history, count_moves, review - 1,
+ &ny, &nx);
break;
case 'B':
- if (review < movecount - 2) {
- review++;
- ny = history[movecount - review - 1].y;
- nx = history[movecount - review - 1].x;
+ review = reviewHistory(history, count_moves, review + 1,
+ &ny, &nx);
+ break;
+
+ case 'R':
+ if (ylimit <= 6) {
+ wprintw(msgwin, "\nworking...");
+ wrefresh(msgwin);
+ test_test = 0;
+ test_size = useBacktracking(squares, history, count_moves);
+ wprintw(msgwin, "\nOk %d:%d (%d tests)",
+ test_size, maxmoves, test_test);
+ review = 0;
+ while (count_moves <= test_size) {
+ markcell(trail,
+ ny = history[count_moves].y,
+ nx = history[count_moves].x);
+ count_moves++;
+ }
} else {
- beep();
+ wprintw(msgwin, "\nBoard is too large.");
}
+ wrefresh(msgwin);
break;
+#if HAVE_CURSCR
case KEY_REDO:
case '\f':
case 'r':
@@ -729,12 +869,13 @@ play(void)
wnoutrefresh(helpwin);
doupdate();
break;
+#endif
case 'q':
case 'x':
goto dropout;
- case '?':
+ case HELP_KEY_1:
show_help(&keyhelp);
break;
@@ -743,12 +884,12 @@ play(void)
break;
}
- col = nx % BWIDTH;
- rw = ny % BDEPTH;
+ col = nx % xlimit;
+ rw = ny % ylimit;
}
dropout:
- if ((count = completed()) < 0)
+ if ((count = completed(squares)) < 0)
wprintw(msgwin, "\nYou won. Care to try again? ");
else
wprintw(msgwin, "\n%d squares filled. Try again? ", count);
@@ -757,9 +898,55 @@ play(void)
(tolower(wgetch(msgwin)) == 'y');
}
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: knight [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -n NUM set board-size to NUM*NUM (default 8x8)"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
+ int ch;
+
+ while ((ch = getopt(argc, argv, "dn:")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+ case 'n':
+ ch = atoi(optarg);
+ if (ch < 3 || ch > 8) {
+ fprintf(stderr, "board size %d is outside [3..8]\n", ch);
+ usage();
+ }
+ xlimit = ylimit = ch;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ if (optind < argc)
+ usage();
+
init_program();
play();
@@ -767,5 +954,3 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
endwin();
ExitProgram(EXIT_SUCCESS);
}
-
-/* knight.c ends here */
diff --git a/test/linedata.h b/test/linedata.h
index 751bc6b..f042ab4 100644
--- a/test/linedata.h
+++ b/test/linedata.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2009-2010,2012 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,6 +27,16 @@
* authorization. *
****************************************************************************/
+/*
+ * $Id: linedata.h,v 1.8 2020/02/02 23:34:34 tom Exp $
+ *
+ * Utility functions for reading a line of text from a file.
+ */
+#ifndef LINEDATA_H_incl
+#define LINEDATA_H_incl 1
+
+#include <test.priv.h>
+
#define isQUIT(c) ((c) == QUIT || (c) == ESCAPE)
#define key_RECUR CTRL('W')
@@ -96,3 +107,5 @@ read_linedata(WINDOW *work)
}
return result;
}
+
+#endif /* LINEDATA_H_incl */
diff --git a/test/linux-color.dat b/test/linux-color.dat
index 528b3f0..ef922eb 100644
--- a/test/linux-color.dat
+++ b/test/linux-color.dat
@@ -1,5 +1,6 @@
##############################################################################
-# Copyright (c) 2004,2006 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2004,2006 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"), #
@@ -25,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: linux-color.dat,v 1.2 2006/04/22 21:40:00 tom Exp $
+# $Id: linux-color.dat,v 1.3 2020/02/08 21:38:22 tom Exp $
# These values are derived from linux/drivers/char/vt.c (default_red[],
# default_grn[] and default_blu[]), commented
/* the default colour table, for VGA+ colour systems */
diff --git a/test/list_keys.c b/test/list_keys.c
new file mode 100644
index 0000000..cdad60e
--- /dev/null
+++ b/test/list_keys.c
@@ -0,0 +1,512 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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"), 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: list_keys.c,v 1.26 2020/02/02 23:34:34 tom Exp $
+ *
+ * Author: Thomas E Dickey
+ *
+ * List function keys for one or more terminals.
+ */
+
+#define USE_TINFO
+#include <test.priv.h>
+
+#if NCURSES_XNAMES
+#if HAVE_TERM_ENTRY_H
+#include <term_entry.h>
+#else
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 0
+#endif
+#endif
+
+#if HAVE_TIGETSTR
+#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
+
+static bool f_opt = FALSE;
+static bool m_opt = FALSE;
+static bool t_opt = FALSE;
+static bool x_opt = FALSE;
+
+typedef enum {
+ ktCursor
+ ,ktFunction
+ ,ktOther
+#if HAVE_USE_EXTENDED_NAMES
+ ,ktExtended
+#endif
+} KEYTYPE;
+
+typedef struct {
+ KEYTYPE type;
+ const char *name;
+} KEYNAMES;
+
+#define Type(n) list[n].type
+#define Name(n) list[n].name
+
+static const char *
+full_name(const char *name)
+{
+ const char *result = name;
+ int n;
+ for (n = 0; strnames[n] != 0; ++n) {
+ if (!strcmp(name, strnames[n])) {
+ result = strfnames[n];
+ break;
+ }
+ }
+ return result;
+}
+
+static int
+show_key(const char *name, bool show)
+{
+ int width = 0;
+ NCURSES_CONST char *value = tigetstr((NCURSES_CONST char *) name);
+
+ if (show && t_opt)
+ fputc('"', stdout);
+
+ if (value != 0 && value != (char *) -1) {
+ while (*value != 0) {
+ char buffer[10];
+ int ch = UChar(*value++);
+ switch (ch) {
+ case '\177':
+ _nc_STRCPY(buffer, "^?", sizeof(buffer));
+ break;
+ case '\033':
+ _nc_STRCPY(buffer, "\\E", sizeof(buffer));
+ break;
+ case '\b':
+ _nc_STRCPY(buffer, "\\b", sizeof(buffer));
+ break;
+ case '\f':
+ _nc_STRCPY(buffer, "\\f", sizeof(buffer));
+ break;
+ case '\n':
+ _nc_STRCPY(buffer, "\\n", sizeof(buffer));
+ break;
+ case '\r':
+ _nc_STRCPY(buffer, "\\r", sizeof(buffer));
+ break;
+ case ' ':
+ _nc_STRCPY(buffer, "\\s", sizeof(buffer));
+ break;
+ case '\t':
+ _nc_STRCPY(buffer, "\\t", sizeof(buffer));
+ break;
+ case '^':
+ _nc_STRCPY(buffer, "\\^", sizeof(buffer));
+ break;
+ case ':':
+ _nc_STRCPY(buffer, "\\072", sizeof(buffer));
+ break;
+ case '\\':
+ _nc_STRCPY(buffer, "\\\\", sizeof(buffer));
+ break;
+ default:
+ if (t_opt && ch == '"') {
+ _nc_STRCPY(buffer, "\"\"", sizeof(buffer));
+ } else if (isgraph(ch)) {
+ _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer))
+ "%c", ch);
+ } else if (ch < 32) {
+ _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer))
+ "^%c", ch + '@');
+ } else {
+ _nc_SPRINTF(buffer, _nc_SLIMIT(sizeof(buffer))
+ "\\%03o", ch);
+ }
+ break;
+ }
+ width += (int) strlen(buffer);
+ if (show)
+ fputs(buffer, stdout);
+ }
+ }
+
+ if (show && t_opt)
+ fputc('"', stdout);
+
+ return width;
+}
+
+static bool
+valid_key(const char *name, TERMINAL **terms, int count)
+{
+ bool result = FALSE;
+ if (*name == 'k') {
+ int k;
+ for (k = 0; k < count; ++k) {
+ set_curterm(terms[k]);
+ if (show_key(name, FALSE)) {
+ result = TRUE;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+static int
+compare_keys(const void *a, const void *b)
+{
+ const KEYNAMES *p = (const KEYNAMES *) a;
+ const KEYNAMES *q = (const KEYNAMES *) b;
+ int result = (int) (p->type - q->type);
+ int pn, qn;
+ if (result == 0) {
+ if (p->type == ktFunction &&
+ sscanf(p->name, "kf%d", &pn) == 1 &&
+ sscanf(q->name, "kf%d", &qn) == 1) {
+ result = (pn - qn);
+ } else {
+ result = strcmp(p->name, q->name);
+ }
+ }
+ return result;
+}
+
+static void
+draw_line(int width)
+{
+ if (!t_opt) {
+ int j;
+ for (j = 0; j < width; ++j) {
+ printf("-");
+ }
+ printf("\n");
+ }
+}
+
+static const char *
+modified_key(const char *name)
+{
+ static char result[100];
+ char buffer[sizeof(result) - 10];
+ int value;
+ char chr;
+ static const char *modifiers[][2] =
+ {
+ {"", ""},
+ {"s-", "shift-"},
+ {"a-", "alt-"},
+ {"as-", "alt-shift-"},
+ {"c-", "ctrl-"},
+ {"sc-", "ctrl-shift-"},
+ {"ac-", "alt-ctrl-"},
+ {"acs-" "alt-ctrl-shift-"},
+ };
+
+ if (strlen(name) > (sizeof(result) - 3)) {
+ *result = '\0';
+ } else if (sscanf(name, "kf%d%c", &value, &chr) == 1 &&
+ value >= 1 &&
+ value <= 63) {
+ /* map 1,2,3,4,5,6,7 to 1,2,5,... */
+ int map = ((value - 1) / 12);
+ int key = ((value - 1) % 12);
+ int bit1 = (map & 2);
+ int bit2 = (map & 4);
+ map &= ~6;
+ map |= (bit1 << 1) | (bit2 >> 1);
+ _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
+ "%sF%d", modifiers[map][(unsigned) f_opt], 1 + key);
+ } else if (sscanf(name, "k%[A-Z]%d%c", buffer, &value, &chr) == 2 &&
+ (value > 1 &&
+ value <= 8) &&
+ (!strcmp(buffer, "UP") ||
+ !strcmp(buffer, "DN") ||
+ !strcmp(buffer, "LFT") ||
+ !strcmp(buffer, "RIT") ||
+ !strcmp(buffer, "IC") ||
+ !strcmp(buffer, "DC") ||
+ !strcmp(buffer, "HOM") ||
+ !strcmp(buffer, "END") ||
+ !strcmp(buffer, "NXT") ||
+ !strcmp(buffer, "PRV"))) {
+ _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
+ "%sk%s", modifiers[value - 1][(unsigned) f_opt], buffer);
+ } else if (sscanf(name, "k%[A-Z]%c", buffer, &chr) == 1 &&
+ (!strcmp(buffer, "UP") ||
+ !strcmp(buffer, "DN"))) {
+ _nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
+ "%sk%s", modifiers[1][(unsigned) f_opt], buffer);
+ } else {
+ *result = '\0';
+ }
+ return result;
+}
+
+static void
+list_keys(TERMINAL **terms, int count)
+{
+ int j, k;
+ int widths0 = 0;
+ int widths1 = 0;
+ int widths2 = 0;
+ int widthsx;
+ int check;
+ size_t total = 0;
+ size_t actual = 0;
+ const char *name = f_opt ? "strfname" : "strname";
+ const char *modifier = "extended";
+ KEYNAMES *list;
+
+ for (total = 0; strnames[total]; ++total) {
+ ;
+ }
+#if NCURSES_XNAMES
+ if (x_opt) {
+ for (k = 0; k < count; ++k) {
+ TERMTYPE *term;
+ set_curterm(terms[k]);
+ term = (TERMTYPE *) cur_term;
+ total += (size_t) (NUM_STRINGS(term) - STRCOUNT);
+ }
+ }
+#endif
+ list = typeCalloc(KEYNAMES, total + 1);
+ for (j = 0; strnames[j]; ++j) {
+ Type(j) = ktOther;
+ if (sscanf(strnames[j], "kf%d", &k) == 1) {
+ Type(j) = ktFunction;
+ } else if (!(strncmp) (strnames[j], "kcu", 3)) {
+ Type(j) = ktCursor;
+ }
+ Name(j) = strnames[j];
+ }
+#if NCURSES_XNAMES
+ if (x_opt) {
+ int m, n;
+
+ for (k = 0; k < count; ++k) {
+ TERMTYPE *term;
+
+ set_curterm(terms[k]);
+ term = (TERMTYPE *) cur_term;
+ for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) {
+ bool found = FALSE;
+ const char *estr = ExtStrname(term, (int) n, strnames);
+ for (m = STRCOUNT; m < j; ++m) {
+ if (!strcmp(estr, Name(m))) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ Type(j) = ktExtended;
+ Name(j++) = estr;
+ }
+ }
+ }
+ }
+#endif
+ actual = (size_t) j;
+ qsort(list, actual, sizeof(KEYNAMES), compare_keys);
+
+ widths0 = (int) strlen(name);
+ if (m_opt)
+ widths1 = (int) strlen(modifier);
+
+ for (k = 0; k < count; ++k) {
+ set_curterm(terms[k]);
+ check = (int) strlen(termname());
+ if (widths2 < check)
+ widths2 = check;
+ }
+ for (j = 0; Name(j) != 0; ++j) {
+ if (valid_key(Name(j), terms, count)) {
+ const char *label = f_opt ? full_name(Name(j)) : Name(j);
+ check = (int) strlen(label);
+ if (widths0 < check)
+ widths0 = check;
+ for (k = 0; k < count; ++k) {
+ set_curterm(terms[k]);
+ check = show_key(Name(j), FALSE) + 1;
+ if (widths2 < check)
+ widths2 = check;
+ if (m_opt) {
+ check = (int) strlen(modified_key(Name(j)));
+ if (widths1 < check)
+ widths1 = check;
+ }
+ }
+ }
+ }
+
+ if (t_opt) {
+ printf("\"%s\"", name);
+ if (m_opt)
+ printf(",\"%s\"", modifier);
+ } else {
+ printf("%-*s", widths0, name);
+ if (m_opt)
+ printf(" %-*s", widths1, modifier);
+ }
+ for (k = 0; k < count; ++k) {
+ set_curterm(terms[k]);
+ if (t_opt) {
+ printf(",\"%s\"", termname());
+ } else if (k + 1 >= count) {
+ printf(" %s", termname());
+ } else {
+ printf(" %-*s", widths2, termname());
+ }
+ }
+ printf("\n");
+
+ widthsx = widths0 + ((count + 1) * widths2);
+
+ for (j = 0; Name(j) != 0; ++j) {
+ if (j == 0 || (Type(j) != Type(j - 1)))
+ draw_line(widthsx);
+ if (valid_key(Name(j), terms, count)) {
+ const char *label = f_opt ? full_name(Name(j)) : Name(j);
+ if (t_opt) {
+ printf("\"%s\"", label);
+ if (m_opt)
+ printf(",\"%s\"", modified_key(Name(j)));
+ } else {
+ printf("%-*s", widths0, label);
+ if (m_opt)
+ printf(" %-*s", widths1, modified_key(Name(j)));
+ }
+ for (k = 0; k < count; ++k) {
+ printf(t_opt ? "," : " ");
+ set_curterm(terms[k]);
+ check = show_key(Name(j), TRUE);
+ if (!t_opt) {
+ if (k + 1 < count) {
+ printf("%*s", widths2 - check, " ");
+ }
+ }
+ }
+ printf("\n");
+ }
+ }
+ free(list);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: list_keys [options] [terminal [terminal2 [...]]]",
+ "",
+ "Print capabilities for terminal special keys.",
+ "",
+ "Options:",
+ " -f print full names",
+ " -m print modifier-column for shift/control keys",
+ " -t print result as CSV table",
+#ifdef NCURSES_VERSION
+ " -x print extended capabilities",
+#endif
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int n;
+ TERMINAL **terms = typeCalloc(TERMINAL *, argc + 1);
+
+ while ((n = getopt(argc, argv, "fmtx")) != -1) {
+ switch (n) {
+ case 'f':
+ f_opt = TRUE;
+ break;
+ case 'm':
+ m_opt = TRUE;
+ break;
+ case 't':
+ t_opt = TRUE;
+ break;
+#ifdef NCURSES_VERSION
+ case 'x':
+ x_opt = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ break;
+ }
+ }
+
+#if HAVE_USE_EXTENDED_NAMES
+ use_extended_names(x_opt);
+#endif
+
+ if (optind < argc) {
+ int found = 0;
+ int status;
+ for (n = optind; n < argc; ++n) {
+ setupterm((NCURSES_CONST char *) argv[n], 1, &status);
+ if (status > 0 && cur_term != 0) {
+ terms[found++] = cur_term;
+ }
+ }
+ if (found)
+ list_keys(terms, found);
+ } else {
+ setupterm(NULL, 1, (int *) 0);
+ terms[0] = cur_term;
+ list_keys(terms, 1);
+ }
+
+ free(terms);
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("This program requires the terminfo arrays\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("This program requires the terminfo functions such as tigetstr\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */
diff --git a/test/listused.sh b/test/listused.sh
index 1c3fe0a..d3e2629 100755
--- a/test/listused.sh
+++ b/test/listused.sh
@@ -1,6 +1,7 @@
#!/bin/sh
##############################################################################
-# Copyright (c) 2003-2006,2010 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2003-2006,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 "Software"), #
@@ -26,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: listused.sh,v 1.8 2010/09/18 15:15:15 tom Exp $
+# $Id: listused.sh,v 1.9 2020/02/02 23:34:34 tom Exp $
# A very simple script to list all entrypoints that are used by either a test
# program, or within the libraries. This relies on the output format of 'nm',
# and assumes that the libraries are configured with TRACE defined, and using
diff --git a/test/lrtest.c b/test/lrtest.c
index da12034..9c77577 100644
--- a/test/lrtest.c
+++ b/test/lrtest.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 1998-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 *
@@ -34,7 +35,7 @@
* This can't be part of the ncurses test-program, because ncurses rips off the
* bottom line to do labels.
*
- * $Id: lrtest.c,v 1.22 2010/05/01 19:11:55 tom Exp $
+ * $Id: lrtest.c,v 1.27 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -148,9 +149,9 @@ main(
nodelay(stdscr, TRUE);
#ifdef TRACE
else if (ch == 'T')
- trace(0);
+ curses_trace(0);
else if (ch == 't')
- trace(TRACE_CALLS | TRACE_ICALLS | TRACE_UPDATE);
+ curses_trace(TRACE_CALLS | TRACE_ICALLS | TRACE_UPDATE);
#endif
#ifdef KEY_RESIZE
else if (ch == KEY_RESIZE) {
@@ -174,8 +175,7 @@ main(
refresh();
}
- curs_set(1);
- endwin();
+ stop_curses();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/make-tar.sh b/test/make-tar.sh
index a71e1e1..c088d07 100755
--- a/test/make-tar.sh
+++ b/test/make-tar.sh
@@ -1,7 +1,8 @@
#!/bin/sh
-# $Id: make-tar.sh,v 1.12 2013/10/26 23:11:43 tom Exp $
+# $Id: make-tar.sh,v 1.16 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 2010-2011,2013 Free Software Foundation, Inc. #
+# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2010-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 "Software"), #
@@ -66,7 +67,7 @@ edit_specfile() {
make_changelog() {
test -f $1 && chmod u+w $1
cat >$1 <<EOF
-`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_MAJOR.$NCURSES_MINOR-$NCURSES_PATCH) unstable; urgency=low
+`echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_MAJOR.$NCURSES_MINOR+$NCURSES_PATCH) unstable; urgency=low
* snapshot of ncurses subpackage for $PKG_NAME.
@@ -80,7 +81,7 @@ test -d ./test && cd ./test
SOURCE=`cd ..;pwd`
BUILD=$TMPDIR/make-tar$$
-trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
+trap "cd /; rm -rf $BUILD; exit 0" EXIT INT QUIT TERM HUP
umask 077
if ! ( mkdir $BUILD )
diff --git a/test/mensetmanus.xbm b/test/mensetmanus.xbm
new file mode 100644
index 0000000..095b8ec
--- /dev/null
+++ b/test/mensetmanus.xbm
@@ -0,0 +1,258 @@
+#define mensetmanus_width 161
+#define mensetmanus_height 145
+
+static char mensetmanus_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x07,
+ 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf7, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x61, 0x00, 0x00, 0xc6,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0xff,
+ 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xe1, 0xff, 0xff, 0x87, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0xf6, 0x1f, 0x00, 0x00,
+ 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x9f, 0x65, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x00,
+ 0x07, 0x80, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x9f, 0x6d, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xff, 0xff, 0xc7,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x89, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00,
+ 0x00, 0xc0, 0xe1, 0x5b, 0xdb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x80, 0x83,
+ 0x5b, 0xdb, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x5b, 0x1b, 0x0c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5b, 0x1b, 0x0c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x80, 0x6d, 0x1b, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0x5b, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0x83, 0x6d, 0x19, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x5b, 0x0b, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0x83, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x80, 0x5b, 0x0f, 0x0e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0x00, 0x80, 0x4b, 0x0f, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x79, 0x1b, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0x6b, 0xbf, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0xfb, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x6d, 0xb7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xed, 0xf7, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xfe,
+ 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xed, 0xd7, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0xf8, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0xe0, 0xfe, 0xd7, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0x7f, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0xd6, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+ 0xbf, 0x73, 0x80, 0x3b, 0x7c, 0x00, 0x00, 0x00, 0xf8, 0xe7, 0xd6, 0xef,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xb9, 0x73, 0xc0,
+ 0x3b, 0xf0, 0x01, 0x00, 0x00, 0xff, 0xc3, 0xbf, 0xe7, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xb8, 0x7f, 0xe0, 0x3b, 0xc0, 0x03,
+ 0x00, 0xc0, 0xbf, 0xc7, 0xbf, 0xe7, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0xb8, 0xff, 0xf8, 0x3b, 0x80, 0x07, 0x00, 0xe0, 0x61,
+ 0x87, 0xfd, 0xe7, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e,
+ 0xb8, 0xf3, 0xff, 0x3b, 0x00, 0x0f, 0x00, 0x78, 0x60, 0x8e, 0xf1, 0x67,
+ 0xc7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xb8, 0xc3, 0x8f,
+ 0x7b, 0x00, 0x0e, 0x00, 0x38, 0xe0, 0x8c, 0x03, 0x66, 0x87, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xb8, 0x03, 0x83, 0x7b, 0x00, 0x1e,
+ 0x00, 0x1c, 0xe0, 0x1d, 0x03, 0x76, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x07, 0xb8, 0xe3, 0x8f, 0xbb, 0x01, 0x39, 0x00, 0x1e, 0xe0,
+ 0x3b, 0x03, 0xf6, 0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f,
+ 0xb8, 0xe3, 0x8f, 0x3b, 0xc6, 0x38, 0x00, 0x17, 0xe0, 0x73, 0x07, 0xfe,
+ 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0b, 0xb8, 0xe7, 0x8e,
+ 0x3b, 0x38, 0x78, 0x00, 0x13, 0xe0, 0x77, 0x06, 0xfe, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x12, 0x3c, 0xff, 0xce, 0x3b, 0x00, 0x78,
+ 0x80, 0x13, 0x60, 0xef, 0x0e, 0xfe, 0x00, 0x00, 0x60, 0x08, 0x00, 0x00,
+ 0x00, 0x70, 0x22, 0x3e, 0xfc, 0xfe, 0x39, 0x00, 0xe8, 0x80, 0x61, 0x60,
+ 0xce, 0x0f, 0xfe, 0x00, 0x00, 0x60, 0xf8, 0x00, 0x00, 0x00, 0x70, 0xc2,
+ 0x39, 0xf8, 0x7e, 0x38, 0x00, 0xc8, 0xc0, 0x81, 0x71, 0xde, 0x0f, 0xfe,
+ 0x00, 0x00, 0x60, 0x88, 0x00, 0x00, 0x00, 0x70, 0x04, 0x38, 0xe0, 0x0e,
+ 0x38, 0x00, 0xc4, 0xc0, 0x01, 0x7e, 0xbc, 0x1f, 0xfe, 0x00, 0x00, 0x60,
+ 0x88, 0x00, 0x00, 0x00, 0x78, 0x04, 0x38, 0xe0, 0x0e, 0x38, 0x00, 0xc4,
+ 0xc1, 0x01, 0x60, 0x3c, 0x1f, 0xfe, 0x00, 0x00, 0x60, 0x84, 0x0f, 0x00,
+ 0x00, 0x78, 0x08, 0x38, 0xe0, 0x0f, 0x38, 0x00, 0x82, 0xe1, 0x01, 0x60,
+ 0x74, 0x3e, 0xfe, 0x00, 0x00, 0x60, 0x44, 0x08, 0x00, 0x00, 0xb8, 0x10,
+ 0x38, 0xe0, 0x0f, 0x38, 0x00, 0x81, 0xe1, 0x00, 0x60, 0xe4, 0x3e, 0xfe,
+ 0x00, 0x00, 0x60, 0x44, 0x08, 0x00, 0x00, 0x98, 0x20, 0x38, 0xf8, 0x3f,
+ 0x38, 0x80, 0x80, 0xe1, 0x01, 0x60, 0xc4, 0x3c, 0xfe, 0x00, 0x00, 0x60,
+ 0x24, 0x0c, 0x00, 0x00, 0x1c, 0xc1, 0x39, 0x3c, 0x78, 0x38, 0x40, 0x80,
+ 0x61, 0x01, 0x60, 0xc4, 0x79, 0xfe, 0x00, 0x00, 0x60, 0x22, 0x32, 0x00,
+ 0x00, 0x1c, 0x01, 0x3e, 0x1c, 0xf0, 0x38, 0xf0, 0x9f, 0x61, 0x01, 0x60,
+ 0x84, 0x7b, 0xee, 0x00, 0x00, 0x60, 0x12, 0x21, 0x00, 0x00, 0x1c, 0x02,
+ 0x38, 0x0e, 0xe7, 0xf8, 0x3f, 0xe0, 0x61, 0x00, 0x60, 0x04, 0xf7, 0xce,
+ 0x00, 0x00, 0x60, 0x92, 0x10, 0x00, 0x00, 0x1c, 0x04, 0x38, 0x06, 0xff,
+ 0x38, 0x40, 0x80, 0x61, 0x02, 0x60, 0x04, 0xe7, 0xcf, 0x00, 0x00, 0x60,
+ 0x8a, 0x18, 0x00, 0x00, 0x1c, 0x18, 0x38, 0x07, 0xf0, 0x38, 0x00, 0x81,
+ 0x61, 0x02, 0x60, 0x04, 0xee, 0xcf, 0xff, 0x03, 0x60, 0x49, 0xe4, 0x00,
+ 0x00, 0x1c, 0x70, 0x38, 0x07, 0xe7, 0x38, 0x00, 0x82, 0x61, 0x04, 0x60,
+ 0x04, 0xdc, 0xcf, 0x01, 0x04, 0x60, 0x25, 0x42, 0x00, 0x00, 0x1c, 0xfe,
+ 0x3f, 0x03, 0xff, 0x38, 0x00, 0x84, 0x61, 0x08, 0x60, 0x04, 0xfc, 0xcf,
+ 0xf8, 0xff, 0x60, 0x95, 0x31, 0x00, 0x00, 0xfc, 0x01, 0xff, 0x03, 0xf0,
+ 0xf8, 0x1f, 0x88, 0x61, 0x10, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0xe1,
+ 0x53, 0x0c, 0x00, 0x00, 0x38, 0xf0, 0xff, 0x03, 0xef, 0xf8, 0x7f, 0x90,
+ 0x61, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x00, 0xff, 0xe3, 0x2b, 0xfe, 0x00,
+ 0x00, 0x18, 0xf8, 0xff, 0x03, 0xff, 0x7c, 0xf0, 0x90, 0x61, 0x00, 0x3e,
+ 0x36, 0xe3, 0xe1, 0x00, 0x00, 0xe3, 0x9f, 0x60, 0x00, 0x00, 0x38, 0x3c,
+ 0x00, 0x03, 0xf0, 0x1f, 0xe0, 0xa0, 0xe1, 0x00, 0x30, 0x22, 0xe2, 0xc0,
+ 0x00, 0xff, 0xe3, 0x7f, 0x18, 0x00, 0x00, 0x38, 0x0e, 0x00, 0x07, 0xe7,
+ 0x07, 0xc0, 0xe1, 0xc1, 0x00, 0x18, 0x22, 0xe2, 0xc0, 0x00, 0x00, 0xe1,
+ 0x1f, 0x07, 0x00, 0x00, 0x38, 0x06, 0x00, 0x07, 0xef, 0x01, 0xc0, 0xc1,
+ 0xc1, 0x01, 0x16, 0x24, 0xe2, 0xc0, 0x01, 0xff, 0xe1, 0xff, 0x00, 0x00,
+ 0x00, 0x70, 0x07, 0x00, 0x0e, 0xf8, 0x00, 0x80, 0xc3, 0xc0, 0xf1, 0x11,
+ 0x24, 0xe4, 0xc0, 0x03, 0xe0, 0xe1, 0x7f, 0x00, 0x00, 0x00, 0x70, 0x07,
+ 0x00, 0x1e, 0x3c, 0x00, 0x80, 0xe3, 0x80, 0x0f, 0x10, 0x24, 0xe4, 0xc0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xe0, 0x03, 0x00, 0xfc, 0x0f,
+ 0x00, 0x00, 0x63, 0x80, 0x01, 0x08, 0x44, 0xe4, 0xc0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x01, 0x00, 0xe0, 0x03, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x73,
+ 0x80, 0x03, 0x08, 0x44, 0xe4, 0xc0, 0xfc, 0x00, 0x07, 0x0e, 0x00, 0x00,
+ 0x00, 0xc0, 0x03, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x33, 0x00, 0x03, 0x08,
+ 0x44, 0xe4, 0xe0, 0xcc, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0xc0, 0x03,
+ 0x00, 0x78, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x07, 0x04, 0x44, 0xe8, 0x70,
+ 0xcc, 0x01, 0x87, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x3e, 0x00,
+ 0x00, 0x80, 0x1f, 0x00, 0x0e, 0x04, 0x44, 0xe8, 0x38, 0xcc, 0x81, 0xe7,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x80, 0x0f,
+ 0x00, 0x1c, 0x02, 0x44, 0xf8, 0x1e, 0xcc, 0xe1, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0f, 0xc0, 0x23, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x38, 0x01,
+ 0x42, 0xfc, 0x0f, 0xcc, 0xf1, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e,
+ 0xf0, 0x39, 0x00, 0x00, 0xe0, 0x03, 0x00, 0xf0, 0x00, 0xc2, 0xff, 0x07,
+ 0xcc, 0x7f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x7c, 0x0e, 0x00,
+ 0x00, 0xf0, 0x01, 0x00, 0xe0, 0x03, 0xe2, 0xe7, 0x07, 0xcc, 0x1f, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xbf, 0x23, 0xe0, 0xff, 0xff, 0x00,
+ 0x00, 0xc0, 0x1f, 0xff, 0x64, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0x3c, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff,
+ 0x7f, 0x64, 0x06, 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
+ 0xf8, 0x1f, 0x78, 0x7c, 0x7f, 0x00, 0x00, 0x00, 0xfc, 0x20, 0x64, 0x06,
+ 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x33, 0x1c,
+ 0x38, 0x66, 0x00, 0x00, 0x00, 0x0c, 0x20, 0x6c, 0x06, 0xcc, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x3e, 0x0e, 0x38, 0x76, 0x00,
+ 0x00, 0x00, 0x0c, 0x20, 0x68, 0x06, 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0xf8, 0x87, 0x0f, 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c,
+ 0x20, 0x68, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+ 0x78, 0xf8, 0x0f, 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06,
+ 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf8, 0xff, 0x0f,
+ 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06, 0xcc, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xf8, 0xff, 0x0e, 0x38, 0x76, 0x00,
+ 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0xf8, 0xe1, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c,
+ 0x08, 0x68, 0x06, 0xcc, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x68, 0x06,
+ 0xcc, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x0e,
+ 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x68, 0x06, 0xcc, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00,
+ 0x00, 0x00, 0x1c, 0x04, 0x68, 0x06, 0xcc, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c,
+ 0x02, 0x68, 0x06, 0xcc, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x68, 0x06,
+ 0xcc, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x38, 0xe0, 0x0e,
+ 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x68, 0x06, 0xcc, 0x1c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00,
+ 0x00, 0x00, 0x18, 0x01, 0x68, 0x06, 0xcc, 0x1c, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x98,
+ 0x00, 0x68, 0x06, 0xcc, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x98, 0x00, 0x68, 0x06,
+ 0xcc, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x38, 0xe0, 0x0e,
+ 0x38, 0x1e, 0x00, 0x00, 0x00, 0x58, 0x00, 0x6c, 0x0e, 0xcc, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x30, 0xe0, 0x0e, 0x38, 0x1e, 0x00,
+ 0x00, 0x00, 0x38, 0x00, 0x64, 0x0e, 0xcc, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x01, 0x70, 0xe0, 0x0e, 0x1c, 0x1e, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x64, 0x1e, 0xcc, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+ 0xe0, 0xe1, 0x0e, 0x0f, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x64, 0x3e,
+ 0xcc, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xef, 0xce,
+ 0x07, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x64, 0x3e, 0xcc, 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0xff, 0xfe, 0x03, 0x1e, 0x00,
+ 0x00, 0x00, 0x18, 0x00, 0x64, 0x7e, 0xcc, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x00, 0xfc, 0xfe, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x64, 0x66, 0xcc, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x00, 0xe0, 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x66, 0xe6,
+ 0xcc, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xe0, 0x0e,
+ 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x62, 0xc6, 0xcd, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x1e, 0x00,
+ 0x00, 0x00, 0x18, 0x00, 0x62, 0xc6, 0xcd, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x70, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x38,
+ 0x00, 0x62, 0x86, 0xcf, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
+ 0xf0, 0xff, 0xff, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x61, 0x86,
+ 0xcf, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x00, 0x00,
+ 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x61, 0x8e, 0xcf, 0xe0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x78, 0x00, 0x00, 0x0e, 0x0e, 0x00,
+ 0x00, 0x00, 0xf8, 0xff, 0x7f, 0xfe, 0xdf, 0xff, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0xf0, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0x3f, 0xff, 0xdf, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
+ 0xe0, 0x01, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x8f, 0x07,
+ 0x9e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xe0, 0x07, 0x00,
+ 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x30, 0x00, 0xc0, 0xff, 0x3f, 0xc0, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0x3f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0x00,
+ 0x38, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0x00, 0x38, 0xe0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0xdc, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00,
+ 0x38, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x9c, 0x03, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x18, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0c, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0c, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0c, 0x00,
+ 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00,
+ 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00,
+ 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x00, 0x18, 0x38, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x06, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00,
+ 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x00,
+ 0x38, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x38, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x18, 0x00,
+ 0x30, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0x00, 0x30, 0xe0, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x3c, 0x00, 0x30, 0xf0, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0x03, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x0c, 0x7e, 0x00, 0x70, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0f,
+ 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xe7, 0x00,
+ 0x70, 0xbc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1f, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xe3, 0x00, 0x60, 0x1e, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xc1, 0x01, 0xe0, 0x0f, 0x0f, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0xf8, 0x80, 0x03, 0xe0, 0x03, 0x1e, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xe0,
+ 0x1b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x78, 0x80, 0x07,
+ 0xe0, 0x01, 0x1c, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x1b, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x0f, 0xe0, 0x01, 0x38,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0xc0, 0x19, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x30, 0x0e, 0x1e, 0xc0, 0x71, 0xf8, 0x00, 0x00, 0x00,
+ 0x78, 0x00, 0xdc, 0x19, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x1f, 0x1e, 0xc0, 0xf9, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/test/mini.xterm_48x48.xpm b/test/mini.xterm_48x48.xpm
new file mode 100644
index 0000000..c4738f8
--- /dev/null
+++ b/test/mini.xterm_48x48.xpm
@@ -0,0 +1,264 @@
+/* XPM */
+static char * mini_xterm_48x48_xpm[] = {
+"48 48 213 2",
+" c None",
+". c #FF0000",
+"+ c #FF5300",
+"@ c #FF5E00",
+"# c #FF4800",
+"$ c #FF4200",
+"% c #FF4000",
+"& c #FF4B00",
+"* c #FF5200",
+"= c #FF5400",
+"- c #FF3500",
+"; c #FF5100",
+"> c #FF5C00",
+", c #FF3000",
+"' c #FF4500",
+") c #FF2000",
+"! c #FF0300",
+"~ c #FF1600",
+"{ c #FF5D00",
+"] c #FF3800",
+"^ c #FF0200",
+"/ c #FF0900",
+"( c #FF2B00",
+"_ c #FF3300",
+": c #FF1A00",
+"< c #FF1300",
+"[ c #FF1200",
+"} c #FF5700",
+"| c #4577BA",
+"1 c #874E78",
+"2 c #887577",
+"3 c #887E77",
+"4 c #887977",
+"5 c #875078",
+"6 c #566CA9",
+"7 c #5E70A1",
+"8 c #884E77",
+"9 c #887677",
+"0 c #7C5B83",
+"a c #795686",
+"b c #008DFE",
+"c c #0012F3",
+"d c #000BF2",
+"e c #008FFE",
+"f c #006CFA",
+"g c #0000F1",
+"h c #0001F1",
+"i c #0020F4",
+"j c #0040F6",
+"k c #0959F0",
+"l c #1158E8",
+"m c #1159E8",
+"n c #0058F9",
+"o c #001DF4",
+"p c #0023F4",
+"q c #005BFA",
+"r c #0060FA",
+"s c #0E58EB",
+"t c #0651F3",
+"u c #0033F5",
+"v c #000EF2",
+"w c #006EFA",
+"x c #0092FF",
+"y c #001FF4",
+"z c #000FF2",
+"A c #0C51EC",
+"B c #326AC9",
+"C c #7A6583",
+"D c #CA6234",
+"E c #FC5F03",
+"F c #FF5800",
+"G c #FF0800",
+"H c #F4060B",
+"I c #007CFB",
+"J c #0013F3",
+"K c #007EFB",
+"L c #FF1800",
+"M c #F3590C",
+"N c #AB6152",
+"O c #4F4EAD",
+"P c #175CE4",
+"Q c #0036F5",
+"R c #0022F4",
+"S c #0095FD",
+"T c #0084FD",
+"U c #0004F1",
+"V c #0051F8",
+"W c #345AC7",
+"X c #E61519",
+"Y c #FF5900",
+"Z c #FF4600",
+"` c #FF0100",
+" . c #446EB9",
+".. c #0034F6",
+"+. c #0032F5",
+"@. c #FF2200",
+"#. c #006FFA",
+"$. c #002DF5",
+"%. c #0086FD",
+"&. c #0046F7",
+"*. c #0015F3",
+"=. c #0076FC",
+"-. c #FF0400",
+";. c #FF2300",
+">. c #FF2900",
+",. c #9E3E61",
+"'. c #0039F6",
+"). c #FF2A00",
+"!. c #FF4300",
+"~. c #0071FB",
+"{. c #005EF9",
+"]. c #004DF7",
+"^. c #008CFE",
+"/. c #0008F2",
+"(. c #001DF3",
+"_. c #007DFB",
+":. c #FF4100",
+"<. c #FF5B00",
+"[. c #A3425C",
+"}. c #994C66",
+"|. c #FF1100",
+"1. c #0072FB",
+"2. c #000AF2",
+"3. c #006EFC",
+"4. c #0017F3",
+"5. c #007FFB",
+"6. c #FF0600",
+"7. c #FF5600",
+"8. c #A56A5A",
+"9. c #A53B5A",
+"0. c #FF4F00",
+"a. c #0076FB",
+"b. c #0076FA",
+"c. c #0093FF",
+"d. c #007DFC",
+"e. c #FF1C00",
+"f. c #A5765A",
+"g. c #A55D5A",
+"h. c #006FFB",
+"i. c #002CF5",
+"j. c #008AFD",
+"k. c #006BF9",
+"l. c #FF3A00",
+"m. c #FF5000",
+"n. c #007BFB",
+"o. c #008BFD",
+"p. c #A5755A",
+"q. c #9A5565",
+"r. c #A43A5B",
+"s. c #FF4D00",
+"t. c #80507F",
+"u. c #FF0F00",
+"v. c #7A5485",
+"w. c #A5555A",
+"x. c #FF0A00",
+"y. c #A53D5A",
+"z. c #A4515B",
+"A. c #A5685A",
+"B. c #A5735A",
+"C. c #FF0700",
+"D. c #FF2E00",
+"E. c #FF1500",
+"F. c #A3705C",
+"G. c #FF0500",
+"H. c #9A4965",
+"I. c #FF0E00",
+"J. c #FF3B00",
+"K. c #FF2D00",
+"L. c #A13C5E",
+"M. c #FF4C00",
+"N. c #62649D",
+"O. c #FF0B00",
+"P. c #FF4700",
+"Q. c #FF1D00",
+"R. c #A56D5A",
+"S. c #FF2C00",
+"T. c #A4465B",
+"U. c #FF1400",
+"V. c #A03E61",
+"W. c #FF3100",
+"X. c #FF1B00",
+"Y. c #FF1000",
+"Z. c #0029F5",
+"`. c #0027F4",
+" + c #4571BA",
+".+ c #FF3900",
+"++ c #FF3200",
+"@+ c #008EFD",
+"#+ c #0019F3",
+"$+ c #0090FD",
+"%+ c #FF0D00",
+"&+ c #FF1E00",
+"*+ c #FF4E00",
+"=+ c #0088FC",
+"-+ c #0087FC",
+";+ c #FF1900",
+">+ c #0036F6",
+",+ c #FF2100",
+"'+ c #0073FB",
+")+ c #0062FA",
+"!+ c #001AF3",
+"~+ c #2463D8",
+"{+ c #3E58BE",
+"]+ c #2A7FD3",
+"^+ c #807B7F",
+"/+ c #008EFB",
+"(+ c #006AFA",
+"_+ c #004CF8",
+":+ c #717B8D",
+"<+ c #EE0B11",
+"[+ c #F73E08",
+"}+ c #FF1F00",
+"|+ c #FF5500",
+" ",
+" ",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . # @ @ @ @ @ @ @ @ @ @ @ @ $ . ",
+" . % & & & * @ @ @ @ @ = & & & & & . . - & & & & & ; @ > & & & & , . ",
+" . . . . . . * @ @ @ @ ; . . . . . . . . . . . . . ' @ ) . . . . . . ",
+" ! ~ { @ @ @ @ ] ^ / ( @ $ . ",
+" ^ _ @ @ @ @ @ : ! < [ > } ^ . ",
+" | 1 2 3 3 3 3 4 5 6 7 8 9 3 0 a ",
+" b c d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d c e ",
+" f g g g g g g h i j k l m n o g g g g g g p q r s t u v g g g g g g g w ",
+" x y g g g g z A B C D E F G H I c g g g g J K L / M N O P Q h g g g g R S ",
+" T g g g U V W X Y @ @ @ @ Z ` ...g g g g +. ` ' @ @.. #.$.g g g g %. ",
+" &.g g *.=. -.;.@ @ @ @ @ >.,.'.g g g g '. / ).@ !.. ~.{.U g g ]. ",
+" ^./.g (._. ` :.@ @ @ @ <.[.'.g g g g '.}.|.<.} ^ . 1.2.g d e ",
+" 3.g 4.5. 6.7.@ @ @ @ 8.'.g g g g '.9.0.@ [ . a./.g b. ",
+" c.R /.d. -.e.@ @ @ @ f.'.g g g g '.g.@ - . h.h i. ",
+" j.k.%. ^ l.@ @ @ f.'.g g g g '.f.m.` n.f o. ",
+" ! * @ @ f.'.g g g g '.p.G . ",
+" ! ~ { @ f.'.g g g g '.q.. ",
+" ^ _ @ f.'.g g g g '.r. ",
+" ^ s.f.'.g g g g '.t. ",
+" ^ u.p.'.g g g g '.v. ",
+" ^ w.'.g g g g '.r. ",
+" x.y.'.g g g g '.z.^ ",
+" ` A.'.g g g g '.B.x.. ",
+" C.D.f.'.g g g g '.f.# ` ",
+" < E.{ F.'.g g g g '.f.@ ( ^ ",
+" : G.; @ H.'.g g g g '.f.@ <.I.^ ",
+" -.J.@ K.L.'.g g g g '.f.@ @ s.` ",
+" I.) @ M.. N.'.g g g g '.f.@ @ @ _ ^ ",
+" L O.F <.6.. '.g g g g '.f.@ @ @ { E.! ",
+" ^ P.@ Q.. '.g g g g '.R.@ @ @ @ * ! ",
+" G S.@ % . '.g g g g '.T.{ @ @ @ @ l.^ ",
+" < U.> 7.^ ..g g g g u V.W.@ @ @ @ @ e.! ",
+" X.-.m.@ Y.. Z.g g g g `. +` M.@ @ @ @ 7.6. ",
+" -..+@ ++. @+#+g g g g #+$+^ %+<.@ @ @ @ :.` ",
+" I.&+@ *+. =+h g g g g h -+ ! >.@ @ @ @ @ ;.^ ",
+" ;+x.} > C.. >+g g g g g g >+ ` Z @ @ @ @ Y / . ",
+" ` ' @ ,+. %.1.'+)+!+g g g g g g g g #+)+~+{+]+^+@ @ @ P.` ",
+" / ).@ !.. /+(+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+(+:+@ @ @ @ ).^ ",
+" I.[ > F . . <+[+@ @ @ @ <.I.` ",
+" . . . . . . 0.@ }+. . . . . . . . . . . . . |+@ @ @ @ s.. . . . . . ",
+" O.@ @ @ @ @ @ @ @ @ @ @ @ @ ^ ! $ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ $ . ",
+" . & & & & & & & & & & & & & . . , & & & & & & & & & & & & & & & , . ",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" ",
+" "};
diff --git a/test/mk-test.awk b/test/mk-test.awk
index df560eb..ac4203a 100644
--- a/test/mk-test.awk
+++ b/test/mk-test.awk
@@ -1,6 +1,7 @@
-# $Id: mk-test.awk,v 1.12 2010/11/06 23:06:48 tom Exp $
+# $Id: mk-test.awk,v 1.23 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 2006-2007,2010 Free Software Foundation, Inc. #
+# Copyright 2019,2020 Thomas E. Dickey #
+# Copyright 2006-2017,2018 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"), #
@@ -67,11 +68,21 @@ END {
}
print "";
}
+ print "SCRIPTS = \\"
+ print " $(srcdir)/savescreen.sh \\"
+ print " $(srcdir)/tput-colorcube \\"
+ print " $(srcdir)/tput-initc \\"
+ print " $(srcdir)/tracemunch"
+ print "DATAFILES = \\"
+ print " $(srcdir)/*.x* \\"
+ print " $(srcdir)/*.dat"
print ""
print "all: $(TESTS)"
print ""
print "sources:"
print ""
+ print "check:"
+ print " @ echo The test-programs are interactive"
print "tags:"
print " $(CTAGS) *.[ch]"
print ""
@@ -83,18 +94,43 @@ END {
if (INSTALL == "yes") {
print "# we might install the test-programs"
print "install \\"
- print "install.test: $(BINDIR) $(TESTS)"
- print " $(SHELL) -c 'for src in $(TESTS); do \\"
+ print "install.test: $(BINDIR) $(DATADIR) $(TESTS)"
+
+ print " @$(SHELL) -c 'for src in $(TESTS); do \\"
print " dst=`echo $$src | $(TRANSFORM)`; \\"
+ print " echo \"installing $$src -> $(BINDIR)/$$dst\"; \\"
print " $(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\"
print " done'"
+
+ print " @$(SHELL) -c 'for src in $(SCRIPTS); do \\"
+ print " dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\"
+ print " echo \"installing $$src -> $(BINDIR)/$$dst\"; \\"
+ print " $(INSTALL_SCRIPT) $$src $(BINDIR)/$$dst; \\"
+ print " done'"
+
+ print " @$(SHELL) -c 'for src in $(DATAFILES); do \\"
+ print " dst=`echo $$src | sed -e 's,^.*/,,'`; \\"
+ print " echo \"installing $$src -> $(DATADIR)/$$dst\"; \\"
+ print " $(INSTALL_DATA) $$src $(DATADIR)/$$dst; \\"
+ print " done'"
print ""
print "uninstall \\"
print "uninstall.test:"
- print " $(SHELL) -c 'for src in $(TESTS); do \\"
+
+ print " @$(SHELL) -c 'for src in $(TESTS); do \\"
print " dst=`echo $$src | $(TRANSFORM)`; \\"
print " rm -f $(BINDIR)/$$dst; \\"
print " done'"
+
+ print " @$(SHELL) -c 'for src in $(SCRIPTS); do \\"
+ print " dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\"
+ print " rm -f $(BINDIR)/$$dst; \\"
+ print " done'"
+
+ print " @$(SHELL) -c 'for src in $(DATAFILES); do \\"
+ print " dst=`echo $$src | sed -e 's,^.*/,,'`; \\"
+ print " rm -f $(DATADIR)/$$dst; \\"
+ print " done'"
} else {
print "install \\"
print "install.test \\"
@@ -107,7 +143,7 @@ END {
print ""
print "clean :: mostlyclean"
print " -$(SHELL) -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\""
- print " -rm -rf *$o screendump *.lis $(TESTS) .libs"
+ print " -rm -rf *$o screendump *.lis $(TESTS) .libs *.dSYM"
print ""
print "distclean :: clean"
print " -rm -f Makefile ncurses_cfg.h config.status config.log"
@@ -116,7 +152,7 @@ END {
print ""
print "lint:"
print " $(SHELL) -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'"
- print "$(BINDIR) :"
+ print "$(BINDIR) $(DATADIR) :"
print " mkdir -p $@"
diff --git a/test/modules b/test/modules
index b1ee5a0..4d60337 100644
--- a/test/modules
+++ b/test/modules
@@ -1,6 +1,7 @@
-# $Id: modules,v 1.51 2014/06/21 15:28:46 tom Exp $
+# $Id: modules,v 1.71 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. #
+# Copyright 2018-2019,2020 Thomas E. Dickey #
+# Copyright 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 "Software"), #
@@ -36,15 +37,18 @@ 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_content progs $(srcdir) $(HEADER_DEPS)
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) $(srcdir)/popup_msg.h
demo_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h
+demo_tabs progs $(srcdir) $(HEADER_DEPS)
demo_termcap progs $(srcdir) $(HEADER_DEPS)
demo_terminfo progs $(srcdir) $(HEADER_DEPS)
ditto progs $(srcdir) $(HEADER_DEPS)
@@ -52,32 +56,41 @@ dots progs $(srcdir) $(HEADER_DEPS)
dots_curses progs $(srcdir) $(HEADER_DEPS)
dots_mvcur progs $(srcdir) $(HEADER_DEPS)
dots_termcap progs $(srcdir) $(HEADER_DEPS)
+dots_xcurses progs $(srcdir) $(HEADER_DEPS)
+dump_window progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_window.h
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)
+padview progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h $(srcdir)/popup_msg.h
+pair_content progs $(srcdir) $(HEADER_DEPS)
+picsmap 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 $(srcdir)/parse_rgb.h
+sp_tinfo progs $(srcdir) $(HEADER_DEPS)
tclock progs $(srcdir) $(HEADER_DEPS)
test_add_wchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
test_addchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
@@ -89,12 +102,15 @@ test_getstr progs $(srcdir) $(HEADER_DEPS)
test_instr progs $(srcdir) $(HEADER_DEPS)
test_inwstr progs $(srcdir) $(HEADER_DEPS)
test_opaque progs $(srcdir) $(HEADER_DEPS)
+test_setupterm progs $(srcdir) $(HEADER_DEPS)
+test_sgr progs $(srcdir) $(HEADER_DEPS)
+test_termattrs progs $(srcdir) $(HEADER_DEPS)
test_vid_puts progs $(srcdir) $(HEADER_DEPS)
test_vidputs progs $(srcdir) $(HEADER_DEPS)
testaddch progs $(srcdir) $(HEADER_DEPS)
testcurs progs $(srcdir) $(HEADER_DEPS)
testscanw progs $(srcdir) $(HEADER_DEPS)
-view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h
+view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h $(srcdir)/popup_msg.h
worm progs $(srcdir) $(HEADER_DEPS)
xmas progs $(srcdir) $(HEADER_DEPS)
diff --git a/test/movewindow.c b/test/movewindow.c
index 9effda4..0c94572 100644
--- a/test/movewindow.c
+++ b/test/movewindow.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2006-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2006-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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: movewindow.c,v 1.39 2013/05/04 19:41:02 tom Exp $
+ * $Id: movewindow.c,v 1.51 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate move functions for windows and derived windows from the curses
* library.
@@ -45,13 +46,18 @@ TODO:
*/
#include <test.priv.h>
-#include <stdarg.h>
+
+#if HAVE_MVDERWIN && HAVE_MVWIN
+
+#include <popup_msg.h>
#ifdef HAVE_XCURSES
#undef derwin
#endif
-#ifdef NCURSES_VERSION
+#if defined(NCURSES_CONST)
+#define CONST_FMT NCURSES_CONST
+#elif defined(PDCURSES)
#define CONST_FMT const
#else
#define CONST_FMT /* nothing */
@@ -73,8 +79,8 @@ typedef struct {
WINDOW *child; /* the actual value */
} FRAME;
-static void head_line(CONST_FMT char *fmt,...) GCC_PRINTFLIKE(1, 2);
-static void tail_line(CONST_FMT char *fmt,...) GCC_PRINTFLIKE(1, 2);
+static void head_line(CONST_FMT char *fmt, ...) GCC_PRINTFLIKE(1, 2);
+static void tail_line(CONST_FMT char *fmt, ...) GCC_PRINTFLIKE(1, 2);
static unsigned num_windows;
static FRAME *all_windows;
@@ -102,6 +108,8 @@ message(int lineno, CONST_FMT char *fmt, va_list argp)
vsprintf(buffer, fmt, argp);
addstr(buffer);
}
+#elif defined(HAVE_VW_PRINTW)
+ vw_printw(stdscr, fmt, argp);
#else
vwprintw(stdscr, fmt, argp);
#endif
@@ -111,7 +119,7 @@ message(int lineno, CONST_FMT char *fmt, va_list argp)
}
static void
-head_line(CONST_FMT char *fmt,...)
+head_line(CONST_FMT char *fmt, ...)
{
va_list argp;
@@ -121,7 +129,7 @@ head_line(CONST_FMT char *fmt,...)
}
static void
-tail_line(CONST_FMT char *fmt,...)
+tail_line(CONST_FMT char *fmt, ...)
{
va_list argp;
@@ -190,6 +198,7 @@ selectcell(WINDOW *parent,
moved = TRUE;
break;
case QUIT:
+ /* FALLTHRU */
case ESCAPE:
return ((PAIR *) 0);
#ifdef NCURSES_MOUSE_VERSION
@@ -211,8 +220,8 @@ selectcell(WINDOW *parent,
break;
}
}
- /* FALLTHRU */
#endif
+ /* FALLTHRU */
default:
res.y = uli + i;
res.x = ulj + j;
@@ -637,7 +646,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 +663,20 @@ 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) {
+ size_t need = (21 + strlen(help[n].msg));
+ msgs[n] = typeMalloc(char, need);
+ _nc_SPRINTF(msgs[n], _nc_SLIMIT(need)
+ "%-20s%s", keyname(help[n].key), help[n].msg);
+ }
+ popup_msg2(current, msgs);
+ for (n = 0; n < SIZEOF(help); ++n) {
+ free(msgs[n]);
}
- box_inside(mywin);
- wmove(mywin, 1, 1);
- wgetch(mywin);
- delwin(mywin);
- refresh_all(current);
+ free(msgs);
}
int
@@ -695,7 +704,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':
@@ -762,5 +771,16 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
wmove(current_win, 0, 0);
}
endwin();
+#if NO_LEAKS
+ free(all_windows);
+#endif
ExitProgram(EXIT_SUCCESS);
}
+#else
+int
+main(void)
+{
+ printf("This program requires the curses mvderwin and mvwin functions\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/ncurses.c b/test/ncurses.c
index e6aa8fa..e3ba7b5 100644
--- a/test/ncurses.c
+++ b/test/ncurses.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -40,7 +41,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.417 2014/10/10 09:09:41 tom Exp $
+$Id: ncurses.c,v 1.522 2020/02/02 23:34:34 tom Exp $
***************************************************************************/
@@ -77,7 +78,6 @@ $Id: ncurses.c,v 1.417 2014/10/10 09:09:41 tom Exp $
#ifdef TRACE
static unsigned save_trace = TRACE_ORDINARY | TRACE_ICALLS | TRACE_CALLS;
-extern unsigned _nc_tracing;
#endif
#else
@@ -142,20 +142,20 @@ extern unsigned _nc_tracing;
#define state_unused
#endif
-#define ToggleAcs(temp,real) temp = ((temp == real) ? 0 : real)
+#define ToggleAcs(temp,real) temp = ((temp == real) ? NULL : real)
#define P(string) printw("%s\n", string)
#define BLANK ' ' /* this is the background character */
-#undef max_colors
-static int max_colors; /* the actual number of colors we'll use */
-static int min_colors; /* the minimum color code */
-static bool use_colors; /* true if we use colors */
+static int MaxColors; /* the actual number of colors we'll use */
+static int MinColors; /* the minimum color code */
+static bool UseColors; /* true if we use colors */
#undef max_pairs
static int max_pairs; /* ...and the number of color pairs */
+#if HAVE_COLOR_CONTENT
typedef struct {
NCURSES_COLOR_T red;
NCURSES_COLOR_T green;
@@ -163,8 +163,10 @@ typedef struct {
} RGB_DATA;
static RGB_DATA *all_colors;
+#endif
static void main_menu(bool);
+static void failed(const char *s) GCC_NORETURN;
static void
failed(const char *s)
@@ -174,35 +176,22 @@ failed(const char *s)
ExitProgram(EXIT_FAILURE);
}
-/* The behavior of mvhline, mvvline for negative/zero length is unspecified,
- * though we can rely on negative x/y values to stop the macro.
- */
-static void
-do_h_line(int y, int x, chtype c, int to)
-{
- if ((to) > (x))
- MvHLine(y, x, c, (to) - (x));
-}
-
-static void
-do_v_line(int y, int x, chtype c, int to)
-{
- if ((to) > (y))
- MvVLine(y, x, c, (to) - (y));
-}
-
static void
Repaint(void)
{
touchwin(stdscr);
+#if HAVE_CURSCR
touchwin(curscr);
wrefresh(curscr);
+#else
+ wrefresh(stdscr);
+#endif
}
static bool
-isQuit(int c)
+isQuit(int c, bool escape)
{
- return ((c) == QUIT || (c) == ESCAPE);
+ return ((c) == QUIT || (escape && ((c) == ESCAPE)));
}
#define case_QUIT QUIT: case ESCAPE
@@ -222,7 +211,7 @@ wGetchar(WINDOW *win)
} else {
_nc_tracing = save_trace;
}
- trace(_nc_tracing);
+ curses_trace(_nc_tracing);
if (_nc_tracing)
Trace(("TOGGLE-TRACING ON"));
}
@@ -233,11 +222,12 @@ wGetchar(WINDOW *win)
}
#define Getchar() wGetchar(stdscr)
+#if USE_SOFTKEYS
/* replaces wgetnstr(), since we want to be able to edit values */
static void
wGetstring(WINDOW *win, char *buffer, int limit)
{
- int y0, x0, x, ch;
+ int y0, x0, x;
bool done = FALSE;
echo();
@@ -246,6 +236,7 @@ wGetstring(WINDOW *win, char *buffer, int limit)
x = (int) strlen(buffer);
while (!done) {
+ int ch;
if (x > (int) strlen(buffer))
x = (int) strlen(buffer);
wmove(win, y0, x0);
@@ -300,6 +291,7 @@ wGetstring(WINDOW *win, char *buffer, int limit)
wmove(win, y0, x0);
noecho();
}
+#endif
#if USE_WIDEC_SUPPORT
static wchar_t
@@ -353,7 +345,7 @@ wGet_wchar(WINDOW *win, wint_t *result)
} else {
_nc_tracing = save_trace;
}
- trace(_nc_tracing);
+ curses_trace(_nc_tracing);
if (_nc_tracing)
Trace(("TOGGLE-TRACING ON"));
}
@@ -365,6 +357,7 @@ wGet_wchar(WINDOW *win, wint_t *result)
#define Get_wchar(result) wGet_wchar(stdscr, result)
/* replaces wgetn_wstr(), since we want to be able to edit values */
+#if USE_SOFTKEYS
static void
wGet_wstring(WINDOW *win, wchar_t *buffer, int limit)
{
@@ -470,8 +463,9 @@ wGet_wstring(WINDOW *win, wchar_t *buffer, int limit)
wmove(win, y0, x0);
noecho();
}
+#endif /* USE_SOFTKEYS */
-#endif
+#endif /* USE_WIDEC_SUPPORT */
static void
Pause(void)
@@ -486,6 +480,7 @@ Cannot(const char *what)
{
printw("\nThis %s terminal %s\n\n", getenv("TERM"), what);
Pause();
+ endwin();
}
static void
@@ -495,7 +490,7 @@ ShellOut(bool message)
addstr("Shelling out...");
def_prog_mode();
endwin();
-#ifdef __MINGW32__
+#ifdef _WIN32
system("cmd.exe");
#else
IGNORE_RC(system("sh"));
@@ -515,10 +510,15 @@ mouse_decode(MEVENT const *ep)
{
static char buf[80 + (5 * 10) + (32 * 15)];
- (void) sprintf(buf, "id %2d at (%2d, %2d, %d) state %4lx = {",
- ep->id, ep->x, ep->y, ep->z, (unsigned long) ep->bstate);
+ (void) _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+ "id %2d at (%2d, %2d, %d) state %4lx = {",
+ ep->id, ep->x, ep->y, ep->z, (unsigned long) ep->bstate);
-#define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");}
+#define SHOW(m, s) \
+ if ((ep->bstate & m)==m) { \
+ _nc_STRCAT(buf, s, sizeof(buf)); \
+ _nc_STRCAT(buf, ", ", sizeof(buf)); \
+ }
SHOW(BUTTON1_RELEASED, "release-1");
SHOW(BUTTON1_PRESSED, "press-1");
@@ -574,14 +574,13 @@ mouse_decode(MEVENT const *ep)
if (buf[strlen(buf) - 1] == ' ')
buf[strlen(buf) - 2] = '\0';
- (void) strcat(buf, "}");
+ _nc_STRCAT(buf, "}", sizeof(buf));
return (buf);
}
static void
show_mouse(WINDOW *win)
{
- int y, x;
MEVENT event;
bool outside;
bool show_loc;
@@ -604,6 +603,7 @@ show_mouse(WINDOW *win)
show_loc = wmouse_trafo(win, &event.y, &event.x, FALSE);
if (show_loc) {
+ int y, x;
getyx(win, y, x);
wmove(win, event.y, event.x);
waddch(win, '*');
@@ -636,15 +636,24 @@ setup_getch(WINDOW *win, GetchFlags flags)
}
static void
-init_getch(WINDOW *win, GetchFlags flags)
+init_getch(WINDOW *win, GetchFlags flags, int delay)
{
memset(flags, FALSE, NUM_GETCH_FLAGS);
flags[UChar('k')] = (win == stdscr);
flags[UChar('m')] = TRUE;
+ flags[UChar('t')] = (delay != 0);
setup_getch(win, flags);
}
+static bool
+blocking_getch(GetchFlags flags, int delay)
+{
+ return ((delay < 0) && flags['t']);
+}
+
+#define ExitOnEscape() (flags[UChar('k')] && flags[UChar('t')])
+
static void
wgetch_help(WINDOW *win, GetchFlags flags)
{
@@ -655,7 +664,8 @@ wgetch_help(WINDOW *win, GetchFlags flags)
,"k -- toggle keypad/literal mode"
,"m -- toggle meta (7-bit/8-bit) mode"
,"^q -- quit"
- ,"s -- shell out\n"
+ ,"s -- shell out"
+ ,"t -- toggle timeout"
,"w -- create a new window"
#ifdef SIGTSTP
,"z -- suspend this process"
@@ -670,13 +680,16 @@ wgetch_help(WINDOW *win, GetchFlags flags)
printw("Type any key to see its %s value. Also:\n",
flags['k'] ? "keypad" : "literal");
for (n = 0; n < SIZEOF(help); ++n) {
+ const char *msg = help[n];
int row = 1 + (int) (n % chk);
int col = (n >= chk) ? COLS / 2 : 0;
- int flg = ((strstr(help[n], "toggle") != 0)
- && (flags[UChar(*help[n])] != FALSE));
+ int flg = ((strstr(msg, "toggle") != 0)
+ && (flags[UChar(*msg)] != FALSE));
+ if (*msg == '^' && ExitOnEscape())
+ msg = "^[,^q -- quit";
if (flg)
(void) standout();
- MvPrintw(row, col, "%s", help[n]);
+ MvPrintw(row, col, "%s", msg);
if (col == 0)
clrtoeol();
if (flg)
@@ -807,12 +820,11 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
{
char buf[BUFSIZ];
int first_y, first_x;
- int c;
int incount = 0;
GetchFlags flags;
- bool blocking = (delay < 0);
- init_getch(win, flags);
+ init_getch(win, flags, delay);
+ notimeout(win, FALSE);
wtimeout(win, delay);
getyx(win, first_y, first_x);
@@ -821,9 +833,11 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
scrollok(win, TRUE);
for (;;) {
+ int c;
+
while ((c = wGetchar(win)) == ERR) {
incount++;
- if (blocking) {
+ if (blocking_getch(flags, delay)) {
(void) wprintw(win, "%05d: input error", incount);
break;
} else {
@@ -831,10 +845,10 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
}
wgetch_wrap(win, first_y);
}
- if (c == ERR && blocking) {
+ if (c == ERR && blocking_getch(flags, delay)) {
wprintw(win, "ERR");
wgetch_wrap(win, first_y);
- } else if (isQuit(c)) {
+ } else if (isQuit(c, ExitOnEscape())) {
break;
} else if (c == 'e') {
flags[UChar('e')] = !flags[UChar('e')];
@@ -860,6 +874,10 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
wgetch_help(win, flags);
} else if (c == 's') {
ShellOut(TRUE);
+ } else if (c == 't') {
+ notimeout(win, flags[UChar('t')]);
+ flags[UChar('t')] = !flags[UChar('t')];
+ wgetch_help(win, flags);
} else if (c == 'w') {
int high = getmaxy(win) - 1 - first_y + 1;
int wide = getmaxx(win) - first_x;
@@ -931,7 +949,7 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
wtimeout(win, -1);
if (!level)
- init_getch(win, flags);
+ init_getch(win, flags, delay);
}
static int
@@ -958,7 +976,7 @@ begin_getch_test(void)
delay = -1;
}
raw();
- move(5, 0);
+ move(6, 0);
return delay;
}
@@ -974,8 +992,8 @@ finish_getch_test(void)
endwin();
}
-static void
-getch_test(void)
+static int
+getch_test(bool recur GCC_UNUSED)
{
int delay = begin_getch_test();
@@ -984,6 +1002,7 @@ getch_test(void)
forget_boxes();
finish_getch_test();
slk_clear();
+ return OK;
}
#if USE_WIDEC_SUPPORT
@@ -1060,11 +1079,10 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
wint_t c;
int incount = 0;
GetchFlags flags;
- bool blocking = (delay < 0);
- int code;
char *temp;
- init_getch(win, flags);
+ init_getch(win, flags, delay);
+ notimeout(win, FALSE);
wtimeout(win, delay);
getyx(win, first_y, first_x);
@@ -1073,9 +1091,11 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
scrollok(win, TRUE);
for (;;) {
+ int code;
+
while ((code = wGet_wchar(win, &c)) == ERR) {
incount++;
- if (blocking) {
+ if (blocking_getch(flags, delay)) {
(void) wprintw(win, "%05d: input error", incount);
break;
} else {
@@ -1083,10 +1103,10 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
}
wgetch_wrap(win, first_y);
}
- if (code == ERR && blocking) {
+ if (code == ERR && blocking_getch(flags, delay)) {
wprintw(win, "ERR");
wgetch_wrap(win, first_y);
- } else if (isQuit((int) c)) {
+ } else if (isQuit((int) c, ExitOnEscape())) {
break;
} else if (c == 'e') {
flags[UChar('e')] = !flags[UChar('e')];
@@ -1125,6 +1145,10 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
wgetch_help(win, flags);
} else if (c == 's') {
ShellOut(TRUE);
+ } else if (c == 't') {
+ notimeout(win, flags[UChar('t')]);
+ flags[UChar('t')] = !flags[UChar('t')];
+ wgetch_help(win, flags);
} else if (c == 'w') {
int high = getmaxy(win) - 1 - first_y + 1;
int wide = getmaxx(win) - first_x;
@@ -1184,11 +1208,11 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
wtimeout(win, -1);
if (!level)
- init_getch(win, flags);
+ init_getch(win, flags, delay);
}
-static void
-get_wch_test(void)
+static int
+x_getch_test(bool recur GCC_UNUSED)
{
int delay = begin_getch_test();
@@ -1197,6 +1221,7 @@ get_wch_test(void)
forget_boxes();
finish_getch_test();
slk_clear();
+ return OK;
}
#endif
@@ -1255,9 +1280,10 @@ my_termattrs(void)
#define ATTRSTRING_1ST 32 /* ' ' */
#define ATTRSTRING_END 126 /* '~' */
-#define COL_ATTRSTRING 25
-#define MARGIN_4_ATTRS (COL_ATTRSTRING + 8)
-#define LEN_ATTRSTRING (COLS - MARGIN_4_ATTRS)
+#define COLS_PRE_ATTRS 5
+#define COLS_AFT_ATTRS 15
+#define COL_ATTRSTRING (COLS_PRE_ATTRS + 17)
+#define LEN_ATTRSTRING (COLS - (COL_ATTRSTRING + COLS_AFT_ATTRS))
#define MAX_ATTRSTRING (ATTRSTRING_END + 1 - ATTRSTRING_1ST)
static char attr_test_string[MAX_ATTRSTRING + 1];
@@ -1282,9 +1308,9 @@ attr_legend(WINDOW *helpwin)
++row;
MvWPrintw(helpwin, row++, col,
"Toggles:");
- if (use_colors) {
+ if (UseColors) {
MvWPrintw(helpwin, row++, col,
- " f/F/b/F toggle foreground/background background color");
+ " f/F/b/B toggle foreground/background background color");
MvWPrintw(helpwin, row++, col,
" t/T toggle text/background color attribute");
}
@@ -1301,7 +1327,7 @@ attr_legend(WINDOW *helpwin)
static void
show_color_attr(int fg, int bg, int tx)
{
- if (use_colors) {
+ if (UseColors) {
printw(" Colors (fg %d, bg %d", fg, bg);
if (tx >= 0)
printw(", text %d", tx);
@@ -1314,7 +1340,7 @@ cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR
{
bool error = FALSE;
- if (use_colors) {
+ if (UseColors) {
switch (ch) {
case 'f':
*fg = (NCURSES_COLOR_T) (*fg + 1);
@@ -1340,12 +1366,12 @@ cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR
break;
}
if (*fg >= COLORS)
- *fg = (NCURSES_COLOR_T) min_colors;
- if (*fg < min_colors)
+ *fg = (NCURSES_COLOR_T) MinColors;
+ if (*fg < MinColors)
*fg = (NCURSES_COLOR_T) (COLORS - 1);
if (*bg >= COLORS)
- *bg = (NCURSES_COLOR_T) min_colors;
- if (*bg < min_colors)
+ *bg = (NCURSES_COLOR_T) MinColors;
+ if (*bg < MinColors)
*bg = (NCURSES_COLOR_T) (COLORS - 1);
if (*tx >= COLORS)
*tx = -1;
@@ -1363,9 +1389,10 @@ adjust_attr_string(int adjust)
{
char save = attr_test_string[0];
int first = ((int) UChar(save)) + adjust;
- int j, k;
if (first >= ATTRSTRING_1ST) {
+ int j, k;
+
for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
if (k > ATTRSTRING_END)
break;
@@ -1412,11 +1439,11 @@ static int
show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *name)
{
int ncv = get_ncv();
- chtype test = attr & (chtype) (~A_ALTCHARSET);
+ chtype test = attr & (chtype) (~(A_ALTCHARSET | A_CHARTEXT));
if (arrow)
- MvPrintw(row, 5, "-->");
- MvPrintw(row, 8, "%s mode:", name);
+ MvPrintw(row, COLS_PRE_ATTRS - 3, "-->");
+ MvPrintw(row, COLS_PRE_ATTRS, "%s mode:", name);
MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
@@ -1429,10 +1456,9 @@ show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *n
werase(win);
if (attr & A_ALTCHARSET) {
const char *s;
- chtype ch;
for (s = attr_test_string; *s != '\0'; ++s) {
- ch = UChar(*s);
+ chtype ch = UChar(*s);
(void) waddch(win, ch | attr);
}
} else {
@@ -1477,15 +1503,16 @@ show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *n
if (found)
printw(" (NCV)");
}
- if ((termattrs() & test) != test)
+ if ((termattrs() & test) != test) {
printw(" (Part)");
+ }
}
}
return row + 2;
}
typedef struct {
- attr_t attr;
+ chtype attr;
NCURSES_CONST char *name;
} ATTR_TBL;
/* *INDENT-OFF* */
@@ -1522,6 +1549,46 @@ init_attr_list(ATTR_TBL * target, attr_t attrs)
return result;
}
+#if USE_WIDEC_SUPPORT
+typedef struct {
+ attr_t attr;
+ NCURSES_CONST char *name;
+} W_ATTR_TBL;
+/* *INDENT-OFF* */
+static const W_ATTR_TBL w_attrs_to_test[] = {
+ { WA_STANDOUT, "STANDOUT" },
+ { WA_REVERSE, "REVERSE" },
+ { WA_BOLD, "BOLD" },
+ { WA_UNDERLINE, "UNDERLINE" },
+ { WA_DIM, "DIM" },
+ { WA_BLINK, "BLINK" },
+ { WA_PROTECT, "PROTECT" },
+#ifdef WA_INVIS
+ { WA_INVIS, "INVISIBLE" },
+#endif
+#ifdef WA_ITALIC
+ { WA_ITALIC, "ITALIC" },
+#endif
+ { WA_NORMAL, "NORMAL" },
+};
+/* *INDENT-ON* */
+
+static unsigned
+init_w_attr_list(W_ATTR_TBL * target, attr_t attrs)
+{
+ unsigned result = 0;
+ size_t n;
+
+ for (n = 0; n < SIZEOF(w_attrs_to_test); ++n) {
+ attr_t test = w_attrs_to_test[n].attr;
+ if (test == WA_NORMAL || (test & attrs) != 0) {
+ target[result++] = w_attrs_to_test[n];
+ }
+ }
+ return result;
+}
+#endif
+
static bool
attr_getc(int *skip,
NCURSES_COLOR_T *fg,
@@ -1546,7 +1613,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);
@@ -1589,8 +1656,8 @@ attr_getc(int *skip,
return result;
}
-static void
-attr_test(void)
+static int
+attr_test(bool recur GCC_UNUSED)
/* test text attributes */
{
int n;
@@ -1599,12 +1666,13 @@ attr_test(void)
NCURSES_COLOR_T bg = COLOR_BLACK;
NCURSES_COLOR_T tx = -1;
int ac = 0;
- unsigned j, k;
WINDOW *my_wins[SIZEOF(attrs_to_test)];
ATTR_TBL my_list[SIZEOF(attrs_to_test)];
unsigned my_size = init_attr_list(my_list, termattrs());
if (my_size > 1) {
+ unsigned j, k;
+
for (j = 0; j < my_size; ++j) {
my_wins[j] = subwin(stdscr,
1, LEN_ATTRSTRING,
@@ -1624,7 +1692,7 @@ attr_test(void)
chtype normal = A_NORMAL | BLANK;
chtype extras = (chtype) ac;
- if (use_colors) {
+ if (UseColors) {
NCURSES_PAIRS_T pair = 0;
if ((fg != COLOR_BLACK) || (bg != COLOR_BLACK)) {
pair = 1;
@@ -1661,10 +1729,10 @@ attr_test(void)
my_list[j].name);
}
- MvPrintw(row, 8,
+ MvPrintw(row, COLS_PRE_ATTRS,
"This terminal does %shave the magic-cookie glitch",
get_xmc() > -1 ? "" : "not ");
- MvPrintw(row + 1, 8, "Enter '?' for help.");
+ MvPrintw(row + 1, COLS_PRE_ATTRS, "Enter '?' for help.");
show_color_attr(fg, bg, tx);
printw(" ACS (%d)", ac != 0);
@@ -1674,8 +1742,10 @@ attr_test(void)
bkgdset(A_NORMAL | BLANK);
erase();
endwin();
+ return OK;
} else {
Cannot("does not support video attributes.");
+ return ERR;
}
}
@@ -1726,9 +1796,10 @@ wide_adjust_attr_string(int adjust)
{
wchar_t save = wide_attr_test_string[0];
int first = ((int) normal_wchar(save)) + adjust;
- int j, k;
if (first >= ATTRSTRING_1ST) {
+ int j, k;
+
for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
if (k > ATTRSTRING_END)
break;
@@ -1774,14 +1845,15 @@ set_wide_background(NCURSES_PAIRS_T pair)
static attr_t
get_wide_background(void)
{
- attr_t result = A_NORMAL;
+ attr_t result = WA_NORMAL;
attr_t attr;
cchar_t ch;
NCURSES_PAIRS_T pair;
- wchar_t wch[10];
memset(&ch, 0, sizeof(ch));
if (getbkgrnd(&ch) != ERR) {
+ wchar_t wch[CCHARW_MAX];
+
if (getcchar(&ch, wch, &attr, &pair, 0) != ERR) {
result = attr;
}
@@ -1794,16 +1866,16 @@ wide_show_attr(WINDOW *win,
int row,
int skip,
bool arrow,
- chtype attr,
+ attr_t attr,
NCURSES_PAIRS_T pair,
const char *name)
{
int ncv = get_ncv();
- chtype test = attr & ~WA_ALTCHARSET;
+ attr_t test = attr & ~WA_ALTCHARSET;
if (arrow)
- MvPrintw(row, 5, "-->");
- MvPrintw(row, 8, "%s mode:", name);
+ MvPrintw(row, COLS_PRE_ATTRS - 3, "-->");
+ MvPrintw(row, COLS_PRE_ATTRS, "%s mode:", name);
MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
@@ -1867,8 +1939,9 @@ wide_show_attr(WINDOW *win,
if (found)
printw(" (NCV)");
}
- if ((term_attrs() & test) != test)
+ if ((term_attrs() & test) != test) {
printw(" (Part)");
+ }
}
}
return row + 2;
@@ -1895,7 +1968,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);
@@ -1946,8 +2019,8 @@ wide_attr_getc(int *skip,
return result;
}
-static void
-wide_attr_test(void)
+static int
+x_attr_test(bool recur GCC_UNUSED)
/* test text attributes using wide-character calls */
{
int n;
@@ -1956,12 +2029,13 @@ wide_attr_test(void)
NCURSES_COLOR_T bg = COLOR_BLACK;
NCURSES_COLOR_T tx = -1;
int ac = 0;
- unsigned j, k;
- ATTR_TBL my_list[SIZEOF(attrs_to_test)];
- WINDOW *my_wins[SIZEOF(attrs_to_test)];
- unsigned my_size = init_attr_list(my_list, term_attrs());
+ W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)];
+ WINDOW *my_wins[SIZEOF(w_attrs_to_test)];
+ unsigned my_size = init_w_attr_list(my_list, term_attrs());
if (my_size > 1) {
+ unsigned j, k;
+
for (j = 0; j < my_size; ++j) {
my_wins[j] = subwin(stdscr,
1, LEN_ATTRSTRING,
@@ -1981,7 +2055,7 @@ wide_attr_test(void)
NCURSES_PAIRS_T pair = 0;
NCURSES_PAIRS_T extras = 0;
- if (use_colors) {
+ if (UseColors) {
pair = (NCURSES_PAIRS_T) (fg != COLOR_BLACK || bg != COLOR_BLACK);
if (pair != 0) {
pair = 1;
@@ -2012,10 +2086,10 @@ wide_attr_test(void)
my_list[j].name);
}
- MvPrintw(row, 8,
+ MvPrintw(row, COLS_PRE_ATTRS,
"This terminal does %shave the magic-cookie glitch",
get_xmc() > -1 ? "" : "not ");
- MvPrintw(row + 1, 8, "Enter '?' for help.");
+ MvPrintw(row + 1, COLS_PRE_ATTRS, "Enter '?' for help.");
show_color_attr(fg, bg, tx);
printw(" ACS (%d)", ac != 0);
@@ -2025,8 +2099,10 @@ wide_attr_test(void)
set_wide_background(0);
erase();
endwin();
+ return OK;
} else {
Cannot("does not support extended video attributes.");
+ return ERR;
}
}
#endif
@@ -2058,21 +2134,32 @@ static NCURSES_CONST char *the_color_names[] =
};
static void
-show_color_name(int y, int x, int color, bool wide)
+show_color_name(int y, int x, int color, bool wide, int zoom)
{
if (move(y, x) != ERR) {
char temp[80];
int width = 8;
- if (wide) {
- sprintf(temp, "%02d", color);
- width = 4;
+ if (wide || zoom) {
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "%02d", color);
+ if (wide)
+ width = 4;
+ if ((int) strlen(temp) >= width) {
+ int pwr2 = 0;
+ while ((1 << pwr2) < color)
+ ++pwr2;
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ width > 4 ? "2^%d" : "^%d", pwr2);
+ }
} else if (color >= 8) {
- sprintf(temp, "[%02d]", color);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "[%02d]", color);
} else if (color < 0) {
- strcpy(temp, "default");
+ _nc_STRCPY(temp, "default", sizeof(temp));
} else {
- sprintf(temp, "%.*s", 16, the_color_names[color]);
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "%.*s", 16, the_color_names[color]);
}
printw("%-*.*s", width, width, temp);
}
@@ -2111,7 +2198,9 @@ color_legend(WINDOW *helpwin, bool wide)
MvWPrintw(helpwin, row++, col,
" r/R toggle reverse on/off");
MvWPrintw(helpwin, row++, col,
- " w/W toggle width between 8/16 colors");
+ " w/W switch width between 4/8 columns");
+ MvWPrintw(helpwin, row++, col,
+ " z/Z zoom out (or in)");
#if USE_WIDEC_SUPPORT
if (wide) {
MvWPrintw(helpwin, row++, col,
@@ -2156,8 +2245,8 @@ color_cycle(int current, int step)
}
/* generate a color test pattern */
-static void
-color_test(void)
+static int
+color_test(bool recur GCC_UNUSED)
{
NCURSES_PAIRS_T i;
int top = 0, width;
@@ -2166,9 +2255,10 @@ color_test(void)
int page_size = (LINES - grid_top);
int pairs_max;
int colors_max = COLORS;
+ int col_limit;
int row_limit;
int per_row;
- char numbered[80];
+ char *numbered = 0;
const char *hello;
bool done = FALSE;
bool opt_acsc = FALSE;
@@ -2176,42 +2266,64 @@ color_test(void)
bool opt_revs = FALSE;
bool opt_nums = FALSE;
bool opt_wide = FALSE;
+ int opt_zoom = 0;
WINDOW *helpwin;
+ if (!UseColors) {
+ Cannot("does not support color.");
+ return ERR;
+ }
+
+ numbered = typeCalloc(char, COLS + 1);
+ done = ((COLS < 16) || (numbered == 0));
+
+ /*
+ * Because the number of colors is usually a power of two, we also use
+ * a power of two for the number of colors shown per line (to be tidy).
+ */
+ for (col_limit = 1; col_limit * 2 < COLS; col_limit *= 2) ;
+
+ reloop:
while (!done) {
int shown = 0;
+ int zoom_size = (1 << opt_zoom);
+ int colors_max1 = colors_max / zoom_size;
+ double colors_max2 = (double) colors_max1 * (double) colors_max1;
pairs_max = PAIR_NUMBER(A_COLOR) + 1;
- if (colors_max * colors_max <= COLOR_PAIRS) {
- int limit = (colors_max - min_colors) * (colors_max - min_colors);
+ if (colors_max2 <= COLOR_PAIRS) {
+ int limit = (colors_max1 - MinColors) * (colors_max1 - MinColors);
if (pairs_max > limit)
pairs_max = limit;
- } else {
- if (pairs_max > COLOR_PAIRS)
- pairs_max = COLOR_PAIRS;
}
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ if (pairs_max < colors_max1)
+ pairs_max = colors_max1;
/* this assumes an 80-column line */
if (opt_wide) {
width = 4;
hello = "Test";
- per_row = (colors_max > 8) ? 16 : 8;
+ per_row = (col_limit / ((colors_max1 > 8) ? width : 8));
} else {
width = 8;
hello = "Hello";
- per_row = 8;
+ per_row = (col_limit / width);
}
- per_row -= min_colors;
+ per_row -= MinColors;
row_limit = (pairs_max + per_row - 1) / per_row;
move(0, 0);
(void) printw("There are %d color pairs and %d colors",
pairs_max, COLORS);
- if (colors_max != COLORS)
- (void) printw(" (using %d colors)", colors_max);
- if (min_colors)
+ if (colors_max1 != COLORS)
+ (void) printw(" (using %d colors)", colors_max1);
+ if (MinColors)
(void) addstr(" besides 'default'");
+ if (opt_zoom)
+ (void) printw(" zoom:%d", opt_zoom);
clrtobot();
MvPrintw(top + 1, 0,
@@ -2221,8 +2333,13 @@ color_test(void)
opt_bold ? "on" : "off");
/* show color names/numbers across the top */
- for (i = 0; i < per_row; i++)
- show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
+ for (i = 0; i < per_row; i++) {
+ show_color_name(top + 2,
+ (i + 1) * width,
+ (int) i * zoom_size + MinColors,
+ opt_wide,
+ opt_zoom);
+ }
/* show a grid of colors, with color names/ numbers on the left */
for (i = (NCURSES_PAIRS_T) (base_row * per_row); i < pairs_max; i++) {
@@ -2230,11 +2347,14 @@ color_test(void)
int col = (i % per_row + 1) * width;
NCURSES_PAIRS_T pair = i;
-#define InxToFG(i) (NCURSES_COLOR_T) ((i % (colors_max - min_colors)) + min_colors)
-#define InxToBG(i) (NCURSES_COLOR_T) ((i / (colors_max - min_colors)) + min_colors)
+ if ((i / per_row) > row_limit)
+ break;
+
+#define InxToFG(i) (int)((((unsigned long)(i) * (unsigned long)zoom_size) % (unsigned long)(colors_max1 - MinColors)) + (unsigned long)MinColors)
+#define InxToBG(i) (int)((((unsigned long)(i) * (unsigned long)zoom_size) / (unsigned long)(colors_max1 - MinColors)) + (unsigned long)MinColors)
if (row >= 0 && move(row, col) != ERR) {
- NCURSES_COLOR_T fg = InxToFG(i);
- NCURSES_COLOR_T bg = InxToBG(i);
+ NCURSES_COLOR_T fg = (NCURSES_COLOR_T) InxToFG(i);
+ NCURSES_COLOR_T bg = (NCURSES_COLOR_T) InxToBG(i);
init_pair(pair, fg, bg);
attron(COLOR_PAIR(pair));
@@ -2246,14 +2366,18 @@ color_test(void)
attron(A_REVERSE);
if (opt_nums) {
- sprintf(numbered, "{%02X}", (int) i);
+ _nc_SPRINTF(numbered, _nc_SLIMIT((size_t) (COLS + 1))
+ "{%02X}", (int) i);
hello = numbered;
}
printw("%-*.*s", width, width, hello);
(void) attrset(A_NORMAL);
- if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
- show_color_name(row, 0, InxToBG(i), opt_wide);
+ if ((i % per_row) == 0 && InxToFG(i) == MinColors) {
+ show_color_name(row, 0,
+ InxToBG(i),
+ opt_wide,
+ opt_zoom);
}
++shown;
} else if (shown) {
@@ -2301,6 +2425,22 @@ color_test(void)
case 'W':
set_color_test(opt_wide, TRUE);
break;
+ case 'z':
+ if (opt_zoom <= 0) {
+ beep();
+ } else {
+ --opt_zoom;
+ goto reloop;
+ }
+ break;
+ case 'Z':
+ if ((1 << opt_zoom) >= colors_max) {
+ beep();
+ } else {
+ ++opt_zoom;
+ goto reloop;
+ }
+ break;
case CTRL('p'):
case KEY_UP:
if (base_row <= 0) {
@@ -2340,7 +2480,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);
@@ -2356,23 +2496,38 @@ color_test(void)
erase();
endwin();
+
+ free(numbered);
+ return OK;
}
#if USE_WIDEC_SUPPORT
+
+#if USE_EXTENDED_COLOR
+#define InitExtendedPair(p,f,g) init_extended_pair((p),(f),(g))
+#define ExtendedColorSet(p) color_set((NCURSES_PAIRS_T) (p), &(p))
+#define EXTENDED_PAIRS_T int
+#else
+#define InitExtendedPair(p,f,g) init_pair((NCURSES_PAIRS_T) (p),(NCURSES_COLOR_T)(f),(NCURSES_COLOR_T)(g))
+#define ExtendedColorSet(p) color_set((NCURSES_PAIRS_T) (p), NULL)
+#define EXTENDED_PAIRS_T NCURSES_PAIRS_T
+#endif
+
/* generate a color test pattern */
-static void
-wide_color_test(void)
+static int
+x_color_test(bool recur GCC_UNUSED)
{
- int i;
+ long i;
int top = 0, width;
int base_row = 0;
int grid_top = top + 3;
int page_size = (LINES - grid_top);
- int pairs_max = (unsigned short) (-1);
+ int pairs_max;
int colors_max = COLORS;
+ int col_limit;
int row_limit;
int per_row;
- char numbered[80];
+ char *numbered = 0;
const char *hello;
bool done = FALSE;
bool opt_acsc = FALSE;
@@ -2381,33 +2536,52 @@ wide_color_test(void)
bool opt_wide = FALSE;
bool opt_nums = FALSE;
bool opt_xchr = FALSE;
- wchar_t buffer[80];
+ int opt_zoom = 0;
+ wchar_t *buffer = 0;
WINDOW *helpwin;
+ if (!UseColors) {
+ Cannot("does not support color.");
+ return ERR;
+ }
+ numbered = typeCalloc(char, COLS + 1);
+ buffer = typeCalloc(wchar_t, COLS + 1);
+ done = ((COLS < 16) || (numbered == 0) || (buffer == 0));
+
+ /*
+ * Because the number of colors is usually a power of two, we also use
+ * a power of two for the number of colors shown per line (to be tidy).
+ */
+ for (col_limit = 1; col_limit * 2 < COLS; col_limit *= 2) ;
+
+ reloop:
while (!done) {
int shown = 0;
+ int zoom_size = (1 << opt_zoom);
+ int colors_max1 = colors_max / zoom_size;
+ double colors_max2 = (double) colors_max1 * (double) colors_max1;
- pairs_max = (unsigned short) (-1);
- if (colors_max * colors_max <= COLOR_PAIRS) {
- int limit = (colors_max - min_colors) * (colors_max - min_colors);
+ pairs_max = ((unsigned) (-1)) / 2;
+ if (colors_max2 <= COLOR_PAIRS) {
+ int limit = (colors_max1 - MinColors) * (colors_max1 - MinColors);
if (pairs_max > limit)
pairs_max = limit;
- } else {
- if (pairs_max > COLOR_PAIRS)
- pairs_max = COLOR_PAIRS;
}
+ if (pairs_max > COLOR_PAIRS)
+ pairs_max = COLOR_PAIRS;
+ if (pairs_max < colors_max1)
+ pairs_max = colors_max1;
- /* this assumes an 80-column line */
if (opt_wide) {
width = 4;
hello = "Test";
- per_row = (colors_max > 8) ? 16 : 8;
+ per_row = (col_limit / ((colors_max1 > 8) ? width : 8));
} else {
width = 8;
hello = "Hello";
- per_row = 8;
+ per_row = (col_limit / width);
}
- per_row -= min_colors;
+ per_row -= MinColors;
if (opt_xchr) {
make_fullwidth_text(buffer, hello);
@@ -2422,10 +2596,12 @@ wide_color_test(void)
move(0, 0);
(void) printw("There are %d color pairs and %d colors",
pairs_max, COLORS);
- if (colors_max != COLORS)
- (void) printw(" (using %d colors)", colors_max);
- if (min_colors)
+ if (colors_max1 != COLORS)
+ (void) printw(" (using %d colors)", colors_max1);
+ if (MinColors)
(void) addstr(" besides 'default'");
+ if (opt_zoom)
+ (void) printw(" zoom:%d", opt_zoom);
clrtobot();
MvPrintw(top + 1, 0,
@@ -2435,27 +2611,37 @@ wide_color_test(void)
opt_bold ? "on" : "off");
/* show color names/numbers across the top */
- for (i = 0; i < per_row; i++)
- show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
+ for (i = 0; i < per_row; i++) {
+ show_color_name(top + 2,
+ ((int) i + 1) * width,
+ (int) i * zoom_size + MinColors,
+ opt_wide,
+ opt_zoom);
+ }
/* show a grid of colors, with color names/ numbers on the left */
for (i = (base_row * per_row); i < pairs_max; i++) {
- int row = grid_top + (i / per_row) - base_row;
- int col = (i % per_row + 1) * width;
- NCURSES_PAIRS_T pair = (NCURSES_PAIRS_T) i;
+ int row = grid_top + ((int) i / per_row) - base_row;
+ int col = ((int) i % per_row + 1) * width;
+ int pair = (int) i;
+
+ if ((i / per_row) > row_limit)
+ break;
if (row >= 0 && move(row, col) != ERR) {
- init_pair(pair, InxToFG(i), InxToBG(i));
- (void) color_set(pair, NULL);
+ InitExtendedPair(pair, InxToFG(i), InxToBG(i));
+ (void) ExtendedColorSet(pair);
if (opt_acsc)
- attr_on(A_ALTCHARSET, NULL);
+ attr_on(WA_ALTCHARSET, NULL);
if (opt_bold)
- attr_on(A_BOLD, NULL);
+ attr_on(WA_BOLD, NULL);
if (opt_revs)
- attr_on(A_REVERSE, NULL);
+ attr_on(WA_REVERSE, NULL);
if (opt_nums) {
- sprintf(numbered, "{%02X}", i);
+ _nc_SPRINTF(numbered,
+ _nc_SLIMIT((size_t) (COLS + 1) * sizeof(wchar_t))
+ "{%02X}", (unsigned) i);
if (opt_xchr) {
make_fullwidth_text(buffer, numbered);
} else {
@@ -2465,8 +2651,11 @@ wide_color_test(void)
addnwstr(buffer, width);
(void) attr_set(A_NORMAL, 0, NULL);
- if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
- show_color_name(row, 0, InxToBG(i), opt_wide);
+ if ((i % per_row) == 0 && InxToFG(i) == MinColors) {
+ show_color_name(row, 0,
+ InxToBG(i),
+ opt_wide,
+ opt_zoom);
}
++shown;
} else if (shown) {
@@ -2520,6 +2709,22 @@ wide_color_test(void)
case 'X':
opt_xchr = TRUE;
break;
+ case 'z':
+ if (opt_zoom <= 0) {
+ beep();
+ } else {
+ --opt_zoom;
+ goto reloop;
+ }
+ break;
+ case 'Z':
+ if ((1 << opt_zoom) >= colors_max) {
+ beep();
+ } else {
+ ++opt_zoom;
+ goto reloop;
+ }
+ break;
case CTRL('p'):
case KEY_UP:
if (base_row <= 0) {
@@ -2559,7 +2764,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);
@@ -2575,9 +2780,14 @@ wide_color_test(void)
erase();
endwin();
+
+ free(numbered);
+ free(buffer);
+ return OK;
}
#endif /* USE_WIDEC_SUPPORT */
+#if HAVE_COLOR_CONTENT
static void
change_color(NCURSES_PAIRS_T current, int field, int value, int usebase)
{
@@ -2602,7 +2812,7 @@ change_color(NCURSES_PAIRS_T current, int field, int value, int usebase)
}
static void
-init_all_colors(void)
+reset_all_colors(void)
{
NCURSES_PAIRS_T c;
@@ -2613,23 +2823,122 @@ init_all_colors(void)
all_colors[c].blue);
}
-#define scaled_rgb(n) ((255 * (n)) / 1000)
+#define okCOLOR(n) ((n) >= 0 && (n) < MaxColors)
+#define okRGB(n) ((n) >= 0 && (n) <= 1000)
+#define DecodeRGB(n) (NCURSES_COLOR_T) ((n * 1000) / 0xffff)
static void
-color_edit(void)
+init_all_colors(bool xterm_colors, char *palette_file)
+{
+ NCURSES_PAIRS_T cp;
+ all_colors = typeMalloc(RGB_DATA, (unsigned) MaxColors);
+ if (!all_colors)
+ failed("all_colors");
+ for (cp = 0; cp < MaxColors; ++cp) {
+ color_content(cp,
+ &all_colors[cp].red,
+ &all_colors[cp].green,
+ &all_colors[cp].blue);
+ }
+ /* xterm and compatible terminals can read results of an OSC string
+ * asking for the current color palette.
+ */
+ if (xterm_colors) {
+ int n;
+ char result[BUFSIZ];
+ int check_n;
+ unsigned check_r, check_g, check_b;
+
+ raw();
+ noecho();
+
+ for (n = 0; n < MaxColors; ++n) {
+ int got;
+
+ fprintf(stderr, "\033]4;%d;?\007", n);
+ got = (int) read(0, result, sizeof(result) - 1);
+ if (got < 0)
+ break;
+ result[got] = '\0';
+ if (sscanf(result, "\033]4;%d;rgb:%x/%x/%x\007",
+ &check_n,
+ &check_r,
+ &check_g,
+ &check_b) == 4 &&
+ check_n == n) {
+ all_colors[n].red = DecodeRGB(check_r);
+ all_colors[n].green = DecodeRGB(check_g);
+ all_colors[n].blue = DecodeRGB(check_b);
+ } else {
+ break;
+ }
+ }
+ reset_prog_mode();
+ }
+ if (palette_file != 0) {
+ FILE *fp = fopen(palette_file, "r");
+ if (fp != 0) {
+ char buffer[BUFSIZ];
+ int red, green, blue;
+ int scale = 1000;
+ int c;
+ while (fgets(buffer, sizeof(buffer), fp) != 0) {
+ if (sscanf(buffer, "scale:%d", &c) == 1) {
+ scale = c;
+ } else if (sscanf(buffer, "%d:%d %d %d",
+ &c,
+ &red,
+ &green,
+ &blue) == 4
+ && okCOLOR(c)
+ && okRGB(red)
+ && okRGB(green)
+ && okRGB(blue)) {
+#define Scaled(n) (NCURSES_COLOR_T) (((n) * 1000) / scale)
+ all_colors[c].red = Scaled(red);
+ all_colors[c].green = Scaled(green);
+ all_colors[c].blue = Scaled(blue);
+ }
+ }
+ fclose(fp);
+ }
+ }
+}
+
+#define scaled_rgb(n) ((255 * (n)) / 1000)
+
+static int
+color_edit(bool recur GCC_UNUSED)
/* display the color test pattern, without trying to edit colors */
{
int i;
- int current = 0;
- int this_c = 0, value = 0, field = 0;
+ int current;
+ int this_c, value, field;
int last_c;
- int top_color = 0;
- int page_size = (LINES - 6);
+ int top_color;
+ int page_size;
+
+ if (!UseColors) {
+ Cannot("does not support color.");
+ return ERR;
+ } else if (!can_change_color()) {
+ Cannot("has hardwired color values.");
+ return ERR;
+ }
- init_all_colors();
- refresh();
+ reset_all_colors();
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ current = 0;
+ this_c = 0;
+ value = 0;
+ field = 0;
+ top_color = 0;
+ page_size = (LINES - 6);
+ erase();
- for (i = 0; i < max_colors; i++)
+ for (i = 0; i < MaxColors; i++)
init_pair((NCURSES_PAIRS_T) i,
(NCURSES_COLOR_T) COLOR_WHITE,
(NCURSES_COLOR_T) i);
@@ -2645,10 +2954,10 @@ color_edit(void)
for (i = (NCURSES_COLOR_T) top_color;
(i - top_color < page_size)
- && (i < max_colors); i++) {
+ && (i < MaxColors); i++) {
char numeric[80];
- sprintf(numeric, "[%d]", i);
+ _nc_SPRINTF(numeric, _nc_SLIMIT(sizeof(numeric)) "[%d]", i);
MvPrintw(2 + i - top_color, 0, "%c %-8s:",
(i == current ? '>' : ' '),
(i < (int) SIZEOF(the_color_names)
@@ -2696,6 +3005,21 @@ color_edit(void)
value = 0;
switch (this_c) {
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ move(0, 0);
+ goto retry;
+#endif
+ case '!':
+ ShellOut(FALSE);
+ /* FALLTHRU */
+ case CTRL('r'):
+ endwin();
+ refresh();
+ break;
+ case CTRL('l'):
+ refresh();
+ break;
case CTRL('b'):
case KEY_PPAGE:
if (current > 0)
@@ -2706,7 +3030,7 @@ color_edit(void)
case CTRL('f'):
case KEY_NPAGE:
- if (current < (max_colors - 1))
+ if (current < (MaxColors - 1))
current += (page_size - 1);
else
beep();
@@ -2714,18 +3038,20 @@ color_edit(void)
case CTRL('p'):
case KEY_UP:
- current = (current == 0 ? (max_colors - 1) : current - 1);
+ current = (current == 0 ? (MaxColors - 1) : current - 1);
break;
case CTRL('n'):
case KEY_DOWN:
- current = (current == (max_colors - 1) ? 0 : current + 1);
+ current = (current == (MaxColors - 1) ? 0 : current + 1);
break;
+ case '\t':
case KEY_RIGHT:
field = (field == 2 ? 0 : field + 1);
break;
+ case KEY_BTAB:
case KEY_LEFT:
field = (field == 0 ? 2 : field - 1);
break;
@@ -2755,7 +3081,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("");
@@ -2768,6 +3094,8 @@ color_edit(void)
P("To increment or decrement a value, use the same procedure, but finish");
P("with a `+' or `-'.");
P("");
+ P("Use `!' to shell-out, ^R or ^L to repaint the screen.");
+ P("");
P("Press 'm' to invoke the top-level menu with the current color settings.");
P("To quit, do ESC");
@@ -2778,7 +3106,7 @@ color_edit(void)
case 'm':
endwin();
main_menu(FALSE);
- for (i = 0; i < max_colors; i++)
+ for (i = 0; i < MaxColors; i++)
init_pair((NCURSES_PAIRS_T) i,
(NCURSES_COLOR_T) COLOR_WHITE,
(NCURSES_COLOR_T) i);
@@ -2795,8 +3123,8 @@ color_edit(void)
if (current < 0)
current = 0;
- if (current >= max_colors)
- current = max_colors - 1;
+ if (current >= MaxColors)
+ current = MaxColors - 1;
if (current < top_color)
top_color = current;
if (current - top_color >= page_size)
@@ -2805,17 +3133,19 @@ color_edit(void)
MvPrintw(LINES - 1, 0, "Number: %d", value);
clrtoeol();
} while
- (!isQuit(this_c));
+ (!isQuit(this_c, TRUE));
erase();
/*
* ncurses does not reset each color individually when calling endwin().
*/
- init_all_colors();
+ reset_all_colors();
endwin();
+ return OK;
}
+#endif /* HAVE_COLOR_CONTENT */
/****************************************************************************
*
@@ -2847,12 +3177,39 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr, ATTR_TBL * list, unsigned li
return result;
}
+#if USE_WIDEC_SUPPORT
+static bool
+cycle_w_attr(int ch, unsigned *at_code, attr_t *attr, W_ATTR_TBL * list, unsigned limit)
+{
+ bool result = TRUE;
+
+ switch (ch) {
+ case 'v':
+ if ((*at_code += 1) >= limit)
+ *at_code = 0;
+ break;
+ case 'V':
+ if (*at_code == 0)
+ *at_code = limit - 1;
+ else
+ *at_code -= 1;
+ break;
+ default:
+ result = FALSE;
+ break;
+ }
+ if (result)
+ *attr = list[*at_code].attr;
+ return result;
+}
+#endif
+
static bool
cycle_colors(int ch, int *fg, int *bg, NCURSES_PAIRS_T *pair)
{
bool result = FALSE;
- if (use_colors) {
+ if (UseColors) {
result = TRUE;
switch (ch) {
case 'F':
@@ -2950,8 +3307,8 @@ call_slk_color(int fg, int bg)
}
#endif
-static void
-slk_test(void)
+static int
+slk_test(bool recur GCC_UNUSED)
/* exercise the soft keys */
{
int c, fmt = 1;
@@ -2969,7 +3326,7 @@ slk_test(void)
c = CTRL('l');
#if HAVE_SLK_COLOR
- if (use_colors) {
+ if (UseColors) {
call_slk_color(fg, bg);
}
#endif
@@ -2997,7 +3354,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':
@@ -3025,9 +3382,9 @@ slk_test(void)
case '7':
case '8':
MvAddStr(SLK_WORK, 0, "Please enter the label value: ");
- strcpy(buf, "");
+ _nc_STRCPY(buf, "", sizeof(buf));
if ((s = slk_label(c - '0')) != 0) {
- strncpy(buf, s, (size_t) 8);
+ _nc_STRNCPY(buf, s, (size_t) 8);
}
wGetstring(stdscr, buf, 8);
slk_set((c - '0'), buf, fmt);
@@ -3054,7 +3411,7 @@ slk_test(void)
}
#if HAVE_SLK_COLOR
if (cycle_colors(c, &fg, &bg, &pair)) {
- if (use_colors) {
+ if (UseColors) {
call_slk_color(fg, bg);
} else {
beep();
@@ -3065,33 +3422,34 @@ slk_test(void)
beep();
break;
}
- } while (!isQuit(c = Getchar()));
+ } while (!isQuit(c = Getchar(), TRUE));
done:
slk_clear();
erase();
endwin();
+ return OK;
}
#if USE_WIDEC_SUPPORT
#define SLKLEN 8
-static void
-wide_slk_test(void)
+static int
+x_slk_test(bool recur GCC_UNUSED)
/* exercise the soft keys */
{
int c, fmt = 1;
wchar_t buf[SLKLEN + 1];
char *s;
- chtype attr = A_NORMAL;
+ attr_t attr = WA_NORMAL;
unsigned at_code = 0;
int fg = COLOR_BLACK;
int bg = COLOR_WHITE;
NCURSES_PAIRS_T pair = 0;
- ATTR_TBL my_list[SIZEOF(attrs_to_test)];
- unsigned my_size = init_attr_list(my_list, term_attrs());
+ W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)];
+ unsigned my_size = init_w_attr_list(my_list, term_attrs());
c = CTRL('l');
- if (use_colors) {
+ if (UseColors) {
call_slk_color(fg, bg);
}
do {
@@ -3117,7 +3475,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':
@@ -3150,14 +3508,15 @@ wide_slk_test(void)
char *temp = strdup(s);
size_t used = strlen(temp);
size_t want = SLKLEN;
- size_t test;
#ifndef state_unused
mbstate_t state;
#endif
buf[0] = L'\0';
while (want > 0 && used != 0) {
+ size_t test;
const char *base = s;
+
reset_mbytes(state);
test = count_mbytes(base, 0, &state);
if (test == (size_t) -1) {
@@ -3183,13 +3542,13 @@ wide_slk_test(void)
goto done;
case 'F':
- if (use_colors) {
+ if (UseColors) {
fg = (NCURSES_COLOR_T) ((fg + 1) % COLORS);
call_slk_color(fg, bg);
}
break;
case 'B':
- if (use_colors) {
+ if (UseColors) {
bg = (NCURSES_COLOR_T) ((bg + 1) % COLORS);
call_slk_color(fg, bg);
}
@@ -3200,7 +3559,7 @@ wide_slk_test(void)
break;
#endif
default:
- if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
+ if (cycle_w_attr(c, &at_code, &attr, my_list, my_size)) {
slk_attr_set(attr, (NCURSES_COLOR_T) (fg || bg), NULL);
slk_touch();
slk_noutrefresh();
@@ -3208,7 +3567,7 @@ wide_slk_test(void)
}
#if HAVE_SLK_COLOR
if (cycle_colors(c, &fg, &bg, &pair)) {
- if (use_colors) {
+ if (UseColors) {
call_slk_color(fg, bg);
} else {
beep();
@@ -3219,12 +3578,13 @@ wide_slk_test(void)
beep();
break;
}
- } while (!isQuit(c = Getchar()));
+ } while (!isQuit(c = Getchar(), TRUE));
done:
slk_clear();
erase();
endwin();
+ return OK;
}
#endif
#endif /* SLK_INIT */
@@ -3249,7 +3609,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));
}
}
@@ -3283,7 +3643,7 @@ show_upper_chars(int base, int pagesize, int repeat, attr_t attr, NCURSES_PAIRS_
int row = 2 + ((int) (code - first) % (pagesize / 2));
int col = ((int) (code - first) / (pagesize / 2)) * COLS / 2;
char tmp[80];
- sprintf(tmp, "%3u (0x%x)", code, code);
+ _nc_SPRINTF(tmp, _nc_SLIMIT(sizeof(tmp)) "%3u (0x%x)", code, code);
MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
do {
@@ -3293,7 +3653,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);
@@ -3338,7 +3698,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);
@@ -3375,7 +3735,6 @@ show_box_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
MvAddCh(LINES / 2, 0, colored_chtype(ACS_LTEE, attr, pair));
MvAddCh(LINES / 2, COLS - 1, colored_chtype(ACS_RTEE, attr, pair));
/* *INDENT-ON* */
-
}
static int
@@ -3387,7 +3746,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;
}
@@ -3449,10 +3808,11 @@ show_acs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
n = show_1_acs(n, repeat, BOTH(ACS_S7));
(void) show_1_acs(n, repeat, BOTH(ACS_S9));
#endif
+#undef BOTH
}
-static void
-acs_display(void)
+static int
+acs_test(bool recur GCC_UNUSED)
{
int c = 'a';
int pagesize = 32;
@@ -3548,7 +3908,7 @@ acs_display(void)
MvPrintw(LINES - 2, 0,
"Select: a=ACS, w=all x=box, %s0=C1, 1-3,+/- non-ASCII, </> repeat, ESC=quit",
pch_kludge);
- if (use_colors) {
+ if (UseColors) {
MvPrintw(LINES - 1, 0,
"v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
my_list[at_code].name,
@@ -3559,26 +3919,26 @@ acs_display(void)
my_list[at_code].name);
}
refresh();
- } while (!isQuit(c = Getchar()));
+ } while (!isQuit(c = Getchar(), TRUE));
Pause();
erase();
endwin();
+ return OK;
}
#if USE_WIDEC_SUPPORT
static cchar_t *
merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, NCURSES_PAIRS_T pair)
{
- int count;
*dst = *src;
do {
+ int count;
TEST_CCHAR(src, count, {
attr |= (test_attrs & A_ALTCHARSET);
setcchar(dst, test_wch, attr, pair, NULL);
- }
- , {
+ }, {
;
});
} while (0);
@@ -3592,15 +3952,15 @@ merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, NCURSES_PAIRS_T p
* into account, use 256 characters for the page.
*/
static void
-show_paged_widechars(int base,
- int pagesize,
+show_paged_widechars(unsigned base,
+ unsigned pagesize,
int repeat,
int space,
attr_t attr,
NCURSES_PAIRS_T pair)
{
- int first = base * pagesize;
- int last = first + pagesize - 1;
+ unsigned first = base * pagesize;
+ unsigned last = first + pagesize - 1;
int per_line = 16;
cchar_t temp;
wchar_t code;
@@ -3611,8 +3971,8 @@ show_paged_widechars(int base,
MvPrintw(0, 20, "Display of Character Codes %#x to %#x", first, last);
attroff(A_BOLD);
- for (code = (wchar_t) first; (int) code <= last; code++) {
- int row = (2 + ((int) code - first) / per_line);
+ for (code = (wchar_t) first; code <= (wchar_t) last; code++) {
+ int row = (2 + (int) (code - (wchar_t) first) / per_line);
int col = 5 * ((int) code % per_line);
int count;
@@ -3621,7 +3981,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));
}
@@ -3633,26 +3993,26 @@ show_paged_widechars(int base,
}
static void
-show_upper_widechars(int first, int repeat, int space, attr_t attr, NCURSES_PAIRS_T pair)
+show_upper_widechars(unsigned first, int repeat, int space, attr_t attr, NCURSES_PAIRS_T pair)
{
cchar_t temp;
wchar_t code;
- int last = first + 31;
+ unsigned last = first + 31;
erase();
attron(A_BOLD);
MvPrintw(0, 20, "Display of Character Codes %d to %d", first, last);
attroff(A_BOLD);
- for (code = (wchar_t) first; (int) code <= last; code++) {
- int row = 2 + ((code - first) % 16);
- int col = ((code - first) / 16) * COLS / 2;
+ for (code = (wchar_t) first; code <= (wchar_t) last; code++) {
+ int row = 2 + ((int) (code - (wchar_t) first) % 16);
+ int col = ((int) (code - (wchar_t) first) / 16) * COLS / 2;
wchar_t codes[10];
char tmp[80];
int count = repeat;
- int y, x;
- sprintf(tmp, "%3ld (0x%lx)", (long) code, (long) code);
+ _nc_SPRINTF(tmp, _nc_SLIMIT(sizeof(tmp))
+ "%3ld (0x%lx)", (long) code, (long) code);
MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
memset(&codes, 0, sizeof(codes));
@@ -3660,6 +4020,8 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, NCURSES_PAIR
setcchar(&temp, codes, attr, pair, 0);
do {
+ int y, x;
+
/*
* Give non-spacing characters something to combine with. If we
* don't, they'll bunch up in a heap on the space after the ":".
@@ -3667,7 +4029,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));
}
@@ -3808,7 +4170,7 @@ show_wacs_chars_double(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
n = show_1_wacs(n, repeat, BOTH2(WACS_DEGREE));
n = show_1_wacs(n, repeat, BOTH2(WACS_DIAMOND));
n = show_1_wacs(n, repeat, BOTH2(WACS_PLMINUS));
- n = show_1_wacs(n, repeat, BOTH2(WACS_PLUS));
+ n = show_1_wacs(n, repeat, BOTH2(WACS_D_PLUS));
#ifdef CURSES_WACS_ARRAY
n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL));
@@ -3869,7 +4231,7 @@ show_wacs_chars_thick(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
n = show_1_wacs(n, repeat, BOTH2(WACS_DEGREE));
n = show_1_wacs(n, repeat, BOTH2(WACS_DIAMOND));
n = show_1_wacs(n, repeat, BOTH2(WACS_PLMINUS));
- n = show_1_wacs(n, repeat, BOTH2(WACS_PLUS));
+ n = show_1_wacs(n, repeat, BOTH2(WACS_T_PLUS));
#ifdef CURSES_WACS_ARRAY
n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL));
@@ -3920,7 +4282,6 @@ show_wbox_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
(void) mvadd_wch(LINES / 2, 0, MERGE_ATTR(0, WACS_LTEE));
(void) mvadd_wch(LINES / 2, COLS - 1, MERGE_ATTR(0, WACS_RTEE));
/* *INDENT-ON* */
-
}
#undef MERGE_ATTR
@@ -3935,7 +4296,8 @@ show_2_wacs(int n, const char *name, const char *code, attr_t attr, NCURSES_PAIR
MvPrintw(row, col, "%*s : ", COLS / 4, name);
(void) attr_set(attr, pair, 0);
- addstr(strncpy(temp, code, 20));
+ _nc_STRNCPY(temp, code, 20);
+ addstr(temp);
(void) attr_set(A_NORMAL, 0, 0);
return n + 1;
}
@@ -3992,27 +4354,29 @@ show_utf8_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
n = SHOW_UTF8(n, "WACS_S7", "\342\216\274");
(void) SHOW_UTF8(n, "WACS_S9", "\342\216\275");
/* *INDENT-ON* */
-
}
/* display the wide-ACS character set */
-static void
-wide_acs_display(void)
+static int
+x_acs_test(bool recur GCC_UNUSED)
{
int c = 'a';
- int digit = 0;
+ unsigned digit = 0;
int repeat = 1;
int space = ' ';
- int pagesize = 32;
- chtype attr = A_NORMAL;
+ unsigned pagesize = 32;
+ attr_t attr = WA_NORMAL;
int fg = COLOR_BLACK;
int bg = COLOR_BLACK;
unsigned at_code = 0;
NCURSES_PAIRS_T pair = 0;
void (*last_show_wacs) (int, attr_t, NCURSES_PAIRS_T) = 0;
- ATTR_TBL my_list[SIZEOF(attrs_to_test)];
- unsigned my_size = init_attr_list(my_list, term_attrs());
+ W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)];
+ unsigned my_size = init_w_attr_list(my_list, term_attrs());
+ char at_page[20];
+ bool pending_code = FALSE;
+ at_page[0] = '\0';
do {
switch (c) {
case CTRL('L'):
@@ -4044,15 +4408,40 @@ wide_acs_display(void)
case 'u':
ToggleAcs(last_show_wacs, show_utf8_chars);
break;
+ case '@':
+ pending_code = !pending_code;
+ if (pending_code) {
+ _nc_SPRINTF(at_page, _nc_SLIMIT(sizeof(at_page)) "%02x", digit);
+ } else if (at_page[0] != '\0') {
+ _nc_SPRINTF(at_page, _nc_SLIMIT(sizeof(at_page)) "%x", digit);
+ }
+ break;
default:
- if (c < 256 && isdigit(c)) {
- digit = (c - '0');
+ if (pending_code && isxdigit(c)) {
+ size_t len = strlen(at_page);
+ if (len && at_page[0] == '0') {
+ memmove(at_page, at_page + 1, len--);
+ }
+ if (len < sizeof(at_page) - 1) {
+ at_page[len++] = (char) c;
+ at_page[len] = '\0';
+ }
+ } else if (pending_code
+ && (c == '\b' || c == KEY_BACKSPACE || c == KEY_DC)) {
+ size_t len = strlen(at_page);
+ if (len)
+ at_page[--len] = '\0';
+ } else if (c < 256 && isdigit(c)) {
+ digit = (unsigned) (c - '0');
last_show_wacs = 0;
} else if (c == '+') {
++digit;
+ _nc_SPRINTF(at_page, _nc_SLIMIT(sizeof(at_page)) "%02x", digit);
last_show_wacs = 0;
} else if (c == '-' && digit > 0) {
--digit;
+ _nc_SPRINTF(at_page, _nc_SLIMIT(sizeof(at_page)) "%02x",
+ UChar(digit));
last_show_wacs = 0;
} else if (c == '>' && repeat < (COLS / 4)) {
++repeat;
@@ -4061,7 +4450,7 @@ wide_acs_display(void)
} else if (c == '_') {
space = (space == ' ') ? '_' : ' ';
last_show_wacs = 0;
- } else if (cycle_attr(c, &at_code, &attr, my_list, my_size)
+ } else if (cycle_w_attr(c, &at_code, &attr, my_list, my_size)
|| cycle_colors(c, &fg, &bg, &pair)) {
if (last_show_wacs != 0)
break;
@@ -4080,10 +4469,14 @@ wide_acs_display(void)
}
MvPrintw(LINES - 4, 0,
- "Select: a/d/t WACS, w=all x=box, u UTF-8, ^L repaint");
+ "Select: a/d/t WACS, w=%d/page, @",
+ pagesize);
+ printw("%s",
+ pending_code ? at_page : "page");
+ addstr(", x=box, u UTF-8, ^L repaint");
MvPrintw(LINES - 3, 2,
"0-9,+/- non-ASCII, </> repeat, _ space, ESC=quit");
- if (use_colors) {
+ if (UseColors) {
MvPrintw(LINES - 2, 2,
"v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
my_list[at_code].name,
@@ -4094,11 +4487,12 @@ wide_acs_display(void)
my_list[at_code].name);
}
refresh();
- } while (!isQuit(c = Getchar()));
+ } while (!isQuit(c = Getchar(), TRUE));
Pause();
erase();
endwin();
+ return OK;
}
#endif
@@ -4106,8 +4500,8 @@ wide_acs_display(void)
/*
* Graphic-rendition test (adapted from vttest)
*/
-static void
-test_sgr_attributes(void)
+static int
+sgr_attr_test(bool recur GCC_UNUSED)
{
int pass;
@@ -4115,7 +4509,7 @@ test_sgr_attributes(void)
chtype normal = ((pass == 0 ? A_NORMAL : A_REVERSE)) | BLANK;
/* Use non-default colors if possible to exercise bce a little */
- if (use_colors) {
+ if (UseColors) {
init_pair(1, COLOR_WHITE, COLOR_BLUE);
normal |= (chtype) COLOR_PAIR(1);
}
@@ -4181,6 +4575,7 @@ test_sgr_attributes(void)
bkgdset(A_NORMAL | BLANK);
erase();
endwin();
+ return OK;
}
/****************************************************************************
@@ -4204,13 +4599,10 @@ FRAME
WINDOW *wind;
};
-#if defined(NCURSES_VERSION)
-#if (NCURSES_VERSION_PATCH < 20070331) && NCURSES_EXT_FUNCS
+#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS
+#if (NCURSES_VERSION_PATCH < 20070331)
#define is_keypad(win) (win)->_use_keypad
#define is_scrollok(win) (win)->_scroll
-#elif !defined(is_keypad)
-#define is_keypad(win) FALSE
-#define is_scrollok(win) FALSE
#endif
#else
#define is_keypad(win) FALSE
@@ -4246,66 +4638,51 @@ HaveScroll(FRAME * curp)
static void
newwin_legend(FRAME * curp)
{
+#define DATA(num, name) { name, num }
static const struct {
const char *msg;
int code;
} legend[] = {
- {
- "^C = create window", 0
- },
- {
- "^N = next window", 0
- },
- {
- "^P = previous window", 0
- },
- {
- "^F = scroll forward", 0
- },
- {
- "^B = scroll backward", 0
- },
- {
- "^K = keypad(%s)", 1
- },
- {
- "^S = scrollok(%s)", 2
- },
- {
- "^W = save window to file", 0
- },
- {
- "^R = restore window", 0
- },
+ DATA(0, "^C = create window"),
+ DATA(0, "^N = next window"),
+ DATA(0, "^P = previous window"),
+ DATA(0, "^F = scroll forward"),
+ DATA(0, "^B = scroll backward"),
+ DATA(1, "^K = keypad(%s)"),
+ DATA(2, "^S = scrollok(%s)"),
+ DATA(0, "^W = save window"),
+ DATA(0, "^R = restore window"),
#if HAVE_WRESIZE
- {
- "^X = resize", 0
- },
+ DATA(0, "^X = resize"),
#endif
- {
- "^Q%s = exit", 3
- }
+ DATA(3, "^Q%s = exit")
};
+#undef DATA
size_t n;
- int x;
bool do_keypad = HaveKeypad(curp);
bool do_scroll = HaveScroll(curp);
char buf[BUFSIZ];
move(LINES - 4, 0);
+
for (n = 0; n < SIZEOF(legend); n++) {
+ int x;
+
switch (legend[n].code) {
default:
- strcpy(buf, legend[n].msg);
+ _nc_STRCPY(buf, legend[n].msg, sizeof(buf));
break;
case 1:
- sprintf(buf, legend[n].msg, do_keypad ? "yes" : "no");
+ _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+ legend[n].msg, do_keypad ? "yes" : "no");
break;
case 2:
- sprintf(buf, legend[n].msg, do_scroll ? "yes" : "no");
+ _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+ legend[n].msg, do_scroll ? "yes" : "no");
break;
case 3:
- sprintf(buf, legend[n].msg, do_keypad ? "/ESC" : "");
+ _nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
+ legend[n].msg, do_keypad ? "/ESC" : "");
break;
}
x = getcurx(stdscr);
@@ -4394,8 +4771,8 @@ selectcell(int uli, int ulj, int lri, int lrj)
break;
}
}
- /* FALLTHRU */
#endif
+ /* FALLTHRU */
default:
res.y = uli + i;
res.x = ulj + j;
@@ -4496,14 +4873,14 @@ delete_framed(FRAME * fp, bool showit)
}
delwin(fp->wind);
- np = (fp == fp->next) ? 0 : fp->next;
+ np = (fp == fp->next) ? NULL : fp->next;
free(fp);
}
return np;
}
-static void
-acs_and_scroll(void)
+static int
+scroll_test(bool recur GCC_UNUSED)
/* Demonstrate windows */
{
int c;
@@ -4525,11 +4902,11 @@ acs_and_scroll(void)
switch (c) {
case CTRL('C'):
if ((neww = typeCalloc(FRAME, (size_t) 1)) == 0) {
- failed("acs_and_scroll");
+ failed("scroll_test");
goto breakout;
}
if ((neww->wind = getwindow()) == (WINDOW *) 0) {
- failed("acs_and_scroll");
+ failed("scroll_test");
free(neww);
goto breakout;
}
@@ -4595,10 +4972,14 @@ acs_and_scroll(void)
} else if ((fp = fopen(DUMPFILE, "w")) == (FILE *) 0) {
transient(current, "Can't open screen dump file");
} else {
- (void) putwin(frame_win(current), fp);
+ int rc = putwin(frame_win(current), fp);
(void) fclose(fp);
- current = delete_framed(current, TRUE);
+ if (rc == OK) {
+ current = delete_framed(current, TRUE);
+ } else {
+ transient(current, "Can't write screen dump file");
+ }
}
break;
@@ -4619,7 +5000,7 @@ acs_and_scroll(void)
wrefresh(neww->wind);
} else {
- failed("acs_and_scroll");
+ failed("scroll_test");
}
(void) fclose(fp);
}
@@ -4630,7 +5011,7 @@ acs_and_scroll(void)
case CTRL('X'): /* resize window */
if (current) {
pair *tmp, ul, lr;
- int i, mx, my;
+ int mx, my;
move(0, 0);
clrtoeol();
@@ -4659,11 +5040,13 @@ acs_and_scroll(void)
wclrtobot(current->wind);
wmove(current->wind, lr.y, lr.x);
}
- if (mx > tmp->x - ul.x)
+ if (mx > tmp->x - ul.x) {
+ int i;
for (i = 0; i < my; i++) {
wmove(current->wind, i, tmp->x - ul.x + 1);
wclrtoeol(current->wind);
}
+ }
wnoutrefresh(current->wind);
memcpy(&lr, tmp, sizeof(pair));
@@ -4684,12 +5067,6 @@ acs_and_scroll(void)
break;
#endif /* HAVE_WRESIZE */
- case KEY_F(10): /* undocumented --- use this to test area clears */
- selectcell(0, 0, LINES - 1, COLS - 1);
- clrtobot();
- refresh();
- break;
-
case KEY_UP:
newwin_move(current, -1, 0);
break;
@@ -4733,7 +5110,7 @@ acs_and_scroll(void)
usescr = frame_win(current);
wrefresh(usescr);
} while
- (!isQuit(c = wGetchar(usescr))
+ (!isQuit(c = wGetchar(usescr), TRUE)
&& (c != ERR));
breakout:
@@ -4747,6 +5124,7 @@ acs_and_scroll(void)
noraw();
erase();
endwin();
+ return OK;
}
/****************************************************************************
@@ -4816,7 +5194,7 @@ mkpanel(NCURSES_COLOR_T color, int rows, int cols, int tly, int tlx)
if ((win = newwin(rows, cols, tly, tlx)) != 0) {
if ((pan = new_panel(win)) == 0) {
delwin(win);
- } else if (use_colors) {
+ } else if (UseColors) {
NCURSES_COLOR_T fg = (NCURSES_COLOR_T) ((color == COLOR_BLUE)
? COLOR_WHITE
: COLOR_BLACK);
@@ -4835,7 +5213,7 @@ mkpanel(NCURSES_COLOR_T color, int rows, int cols, int tly, int tlx)
rmpanel(pan)
--------------------------------------------------------------------------*/
static void
-rmpanel(PANEL * pan)
+rmpanel(PANEL *pan)
{
WINDOW *win = panel_window(pan);
del_panel(pan);
@@ -4867,7 +5245,7 @@ init_panel(WINDOW *win)
}
static void
-fill_panel(PANEL * pan)
+fill_panel(PANEL *pan)
{
WINDOW *win = panel_window(pan);
const char *userptr = (const char *) panel_userptr(pan);
@@ -4904,7 +5282,7 @@ init_wide_panel(WINDOW *win)
}
static void
-fill_wide_panel(PANEL * pan)
+fill_wide_panel(PANEL *pan)
{
WINDOW *win = panel_window(pan);
const char *userptr = (const char *) panel_userptr(pan);
@@ -4927,7 +5305,7 @@ fill_wide_panel(PANEL * pan)
#define MAX_PANELS 5
static void
-canned_panel(PANEL * px[MAX_PANELS + 1], NCURSES_CONST char *cmd)
+canned_panel(PANEL *px[MAX_PANELS + 1], NCURSES_CONST char *cmd)
{
int which = cmd[1] - '0';
@@ -4953,7 +5331,7 @@ canned_panel(PANEL * px[MAX_PANELS + 1], NCURSES_CONST char *cmd)
wait_a_while(nap_msec);
}
-static void
+static int
demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
{
int count;
@@ -5092,7 +5470,24 @@ demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
erase();
endwin();
+ return OK;
+}
+
+#if USE_LIBPANEL
+static int
+panel_test(bool recur GCC_UNUSED)
+{
+ return demo_panels(init_panel, fill_panel);
}
+#endif
+
+#if USE_WIDEC_SUPPORT && USE_LIBPANEL
+static int
+x_panel_test(bool recur GCC_UNUSED)
+{
+ return demo_panels(init_wide_panel, fill_wide_panel);
+}
+#endif
#endif /* USE_LIBPANEL */
/****************************************************************************
@@ -5101,6 +5496,25 @@ demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
*
****************************************************************************/
+#if HAVE_NEWPAD
+
+/* The behavior of mvhline, mvvline for negative/zero length is unspecified,
+ * though we can rely on negative x/y values to stop the macro.
+ */
+static void
+do_h_line(int y, int x, chtype c, int to)
+{
+ if ((to) > (x))
+ MvHLine(y, x, c, (to) - (x));
+}
+
+static void
+do_v_line(int y, int x, chtype c, int to)
+{
+ if ((to) > (y))
+ MvVLine(y, x, c, (to) - (y));
+}
+
#define GRIDSIZE 3
static bool pending_pan = FALSE;
@@ -5143,10 +5557,15 @@ panner_v_cleanup(int from_y, int from_x, int to_y)
}
static void
-fill_pad(WINDOW *panpad, bool pan_lines)
+fill_pad(WINDOW *panpad, bool pan_lines, bool colored)
{
int y, x;
unsigned gridcount = 0;
+ chtype fill = 0;
+#ifdef A_COLOR
+ if (colored)
+ fill = (chtype) COLOR_PAIR(1);
+#endif
wmove(panpad, 0, 0);
for (y = 0; y < getmaxy(panpad); y++) {
@@ -5160,7 +5579,7 @@ fill_pad(WINDOW *panpad, bool pan_lines)
waddch(panpad, pan_lines ? ACS_LTEE : '+');
else
waddch(panpad, (chtype) ((pan_lines ? 'a' : 'A') +
- (int) (gridcount++ % 26)));
+ (int) (gridcount++ % 26)) | fill);
} else if (y % GRIDSIZE == 0)
waddch(panpad, pan_lines ? ACS_HLINE : '-');
else if (x % GRIDSIZE == 0)
@@ -5174,7 +5593,8 @@ fill_pad(WINDOW *panpad, bool pan_lines)
static void
panner(WINDOW *pad,
int top_x, int top_y, int porty, int portx,
- int (*pgetc) (WINDOW *))
+ int (*pgetc) (WINDOW *),
+ bool colored)
{
#if HAVE_GETTIMEOFDAY
struct timeval before, after;
@@ -5211,8 +5631,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);
@@ -5221,7 +5641,7 @@ panner(WINDOW *pad,
break;
case 'a':
pan_lines = !pan_lines;
- fill_pad(pad, pan_lines);
+ fill_pad(pad, pan_lines, colored);
pending_pan = FALSE;
break;
@@ -5440,13 +5860,13 @@ padgetch(WINDOW *win)
{
static int count;
static int last;
- int c;
if ((pending_pan = (count > 0)) != FALSE) {
count--;
pending_pan = (count != 0);
} else {
for (;;) {
+ int c;
switch (c = wGetchar(win)) {
case '!':
ShellOut(FALSE);
@@ -5507,18 +5927,24 @@ padgetch(WINDOW *win)
#define PAD_HIGH 200
#define PAD_WIDE 200
-static void
-demo_pad(void)
+static int
+pad_test(bool recur GCC_UNUSED)
/* Demonstrate pads. */
{
WINDOW *panpad = newpad(PAD_HIGH, PAD_WIDE);
if (panpad == 0) {
Cannot("cannot create requested pad");
- return;
+ return ERR;
}
-
- fill_pad(panpad, FALSE);
+#ifdef A_COLOR
+ if (UseColors) {
+ init_pair(1, COLOR_BLACK, COLOR_GREEN);
+ init_pair(2, COLOR_CYAN, COLOR_BLUE);
+ wbkgd(panpad, (chtype) (COLOR_PAIR(2) | ' '));
+ }
+#endif
+ fill_pad(panpad, FALSE, TRUE);
panner_legend(LINES - 4);
panner_legend(LINES - 3);
@@ -5531,12 +5957,14 @@ demo_pad(void)
* We'll still be able to widen it during a test, since that's required
* for testing boundaries.
*/
- panner(panpad, 2, 2, LINES - 5, COLS - 15, padgetch);
+ panner(panpad, 2, 2, LINES - 5, COLS - 15, padgetch, TRUE);
delwin(panpad);
endwin();
erase();
+ return OK;
}
+#endif /* HAVE_NEWPAD */
/****************************************************************************
*
@@ -5554,10 +5982,11 @@ Continue(WINDOW *win)
wGetchar(win);
}
-static void
-flushinp_test(WINDOW *win)
+static int
+flushinp_test(bool recur GCC_UNUSED)
/* Input test, adapted from John Burnell's PDCurses tester */
{
+ WINDOW *win = stdscr;
int w, h, bx, by, sw, sh, i;
WINDOW *subWin;
@@ -5568,10 +5997,10 @@ flushinp_test(WINDOW *win)
sw = w / 3;
sh = h / 3;
if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == 0)
- return;
+ return ERR;
#ifdef A_COLOR
- if (use_colors) {
+ if (UseColors) {
init_pair(2, COLOR_CYAN, COLOR_BLUE);
wbkgd(subWin, (chtype) (COLOR_PAIR(2) | ' '));
}
@@ -5635,6 +6064,7 @@ flushinp_test(WINDOW *win)
Continue(win);
cbreak();
+ return OK;
}
/****************************************************************************
@@ -5692,8 +6122,8 @@ static CONST_MENUS char *animals[] =
(char *) 0
};
-static void
-menu_test(void)
+static int
+menu_test(bool recur GCC_UNUSED)
{
MENU *m;
ITEM *items[SIZEOF(animals)];
@@ -5755,6 +6185,7 @@ menu_test(void)
#ifdef NCURSES_MOUSE_VERSION
mousemask(0, (mmask_t *) 0);
#endif
+ return OK;
}
#ifdef TRACE
@@ -5789,29 +6220,31 @@ static char *
tracetrace(unsigned tlevel)
{
static char *buf;
+ static size_t need = 12;
int n;
if (buf == 0) {
- size_t need = 12;
for (n = 0; t_tbl[n].name != 0; n++)
need += strlen(t_tbl[n].name) + 2;
buf = typeMalloc(char, need);
if (!buf)
failed("tracetrace");
}
- sprintf(buf, "0x%02x = {", tlevel);
+ _nc_SPRINTF(buf, _nc_SLIMIT(need) "0x%02x = {", tlevel);
if (tlevel == 0) {
- sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name);
+ _nc_STRCAT(buf, t_tbl[0].name, need);
+ _nc_STRCAT(buf, ", ", need);
} else {
for (n = 1; t_tbl[n].name != 0; n++)
if ((tlevel & t_tbl[n].mask) == t_tbl[n].mask) {
- strcat(buf, t_tbl[n].name);
- strcat(buf, ", ");
+ _nc_STRCAT(buf, t_tbl[n].name, need);
+ _nc_STRCAT(buf, ", ", need);
}
}
if (buf[strlen(buf) - 2] == ',')
buf[strlen(buf) - 2] = '\0';
- return (strcat(buf, "}"));
+ _nc_STRCAT(buf, "}", need);
+ return buf;
}
/* fake a dynamically reconfigurable menu using the 0th entry to deselect
@@ -5853,8 +6286,8 @@ run_trace_menu(MENU * m)
}
}
-static void
-trace_set(void)
+static int
+trace_set(bool recur GCC_UNUSED)
/* interactively set the trace level */
{
MENU *m;
@@ -5910,7 +6343,7 @@ trace_set(void)
for (ip = menu_items(m); *ip; ip++)
if (item_value(*ip))
newtrace |= t_tbl[item_index(*ip)].mask;
- trace(newtrace);
+ curses_trace(newtrace);
Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
MvPrintw(LINES - 2, 0,
@@ -5924,6 +6357,8 @@ trace_set(void)
free_menu(m);
for (ip = items; *ip; ip++)
free_item(*ip);
+
+ return OK;
}
#endif /* TRACE */
#endif /* USE_LIBMENU */
@@ -5959,7 +6394,7 @@ make_field(int frow, int fcol, int rows, int cols, bool secure)
}
static void
-display_form(FORM * f)
+display_form(FORM *f)
{
WINDOW *w;
int rows, cols;
@@ -5977,7 +6412,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);
@@ -5990,7 +6425,7 @@ erase_form(FORM * f)
}
static int
-edit_secure(FIELD * me, int c)
+edit_secure(FIELD *me, int c)
{
int rows, cols, frow, fcol, nrow, nbuf;
@@ -6000,10 +6435,10 @@ edit_secure(FIELD * me, int c)
size_t have = (source ? strlen(source) : 0) + 1;
size_t need = 80 + have;
char *temp = malloc(need);
- size_t len;
if (temp != 0) {
- strncpy(temp, source ? source : "", have + 1);
+ size_t len;
+ _nc_STRNCPY(temp, source ? source : "", have + 1);
len = (size_t) (char *) field_userptr(me);
if (c <= KEY_MAX) {
if (isgraph(c) && (len + 1) < sizeof(temp)) {
@@ -6056,7 +6491,7 @@ edit_secure(FIELD * me, int c)
}
static int
-form_virtualize(FORM * f, WINDOW *w)
+form_virtualize(FORM *f, WINDOW *w)
{
/* *INDENT-OFF* */
static const struct {
@@ -6105,7 +6540,6 @@ form_virtualize(FORM * f, WINDOW *w)
static int mode = REQ_INS_MODE;
int c = wGetchar(w);
- unsigned n;
FIELD *me = current_field(f);
bool current = TRUE;
@@ -6117,6 +6551,7 @@ form_virtualize(FORM * f, WINDOW *w)
}
c = mode;
} else {
+ unsigned n;
for (n = 0; n < SIZEOF(lookup); n++) {
if (lookup[n].code == c) {
c = lookup[n].result;
@@ -6163,7 +6598,7 @@ form_virtualize(FORM * f, WINDOW *w)
}
static int
-my_form_driver(FORM * form, int c)
+my_form_driver(FORM *form, int c)
{
if (c == (MAX_FORM_COMMAND + 1)
&& form_driver(form, REQ_VALIDATION) == E_OK)
@@ -6248,15 +6683,14 @@ CHAR_CHECK_CB(pw_char_check)
return (isgraph(ch) ? TRUE : FALSE);
}
-static void
-demo_forms(void)
+static int
+form_test(bool recur GCC_UNUSED)
{
- WINDOW *w;
FORM *form;
FIELD *f[12], *secure;
FIELDTYPE *fty_middle = new_fieldtype(mi_field_check, mi_char_check);
FIELDTYPE *fty_passwd = new_fieldtype(pw_field_check, pw_char_check);
- int finished = 0, c;
+ int c;
unsigned n = 0;
#ifdef NCURSES_MOUSE_VERSION
@@ -6306,6 +6740,8 @@ demo_forms(void)
f[n] = (FIELD *) 0;
if ((form = new_form(f)) != 0) {
+ WINDOW *w;
+ int finished = 0;
display_form(form);
@@ -6342,6 +6778,7 @@ demo_forms(void)
#ifdef NCURSES_MOUSE_VERSION
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
#endif
+ return OK;
}
#endif /* USE_LIBFORM */
@@ -6351,6 +6788,75 @@ demo_forms(void)
*
****************************************************************************/
+#if HAVE_COPYWIN /* ...and overlay, overwrite */
+
+static const int overlap_HEAD = 1;
+static const int overlap_FOOT = 6;
+
+static WINDOW *
+make_overlap(int n)
+{
+ WINDOW *result;
+ int y, x;
+
+ getmaxyx(stdscr, y, x);
+ if (y < 23 || x < 80) {
+ Cannot("The screen is too small for this test");
+ result = 0;
+ } else {
+ int ymax = y - (overlap_HEAD + overlap_FOOT);
+ int high = ymax / 5; /* equal-sized parts for cross */
+ int xmax = x - 2; /* margin */
+ int wide = (xmax / 5) & ~1;
+ int lmar, tmar;
+
+ if (high > 8)
+ high = 8;
+
+ if (wide > 8)
+ wide = 8;
+
+ tmar = (ymax - (5 * high)) / 2 + overlap_HEAD;
+ lmar = (xmax - (5 * wide)) / 2;
+
+ if (n == 0) {
+ result = newwin(3 * high, 3 * wide, tmar, lmar);
+ } else {
+ result = newwin(3 * high, 3 * wide, tmar + 2 * high, lmar + 2 * wide);
+ }
+ }
+ return result;
+}
+
+static void
+clear_overlap(void)
+{
+ int row;
+
+ for (row = overlap_HEAD; row < LINES - overlap_FOOT; ++row) {
+ move(row, 0);
+ clrtoeol();
+ }
+}
+
+static int
+move_overlap(int shift, WINDOW *win1)
+{
+ int ymax = getmaxy(stdscr) - (overlap_HEAD + overlap_FOOT);
+ int high = ymax / 5; /* equal-sized parts for cross */
+ int tmar;
+ int xmax1 = getmaxx(win1) + 1;
+ int lmar1 = (COLS - (5 * (xmax1) / 3)) / 2;
+ int rc = ERR;
+
+ if (high > 8)
+ high = 8;
+ tmar = (ymax - (5 * high)) / 2 + overlap_HEAD;
+
+ rc = mvwin(win1, tmar, lmar1 + shift);
+ return rc;
+}
+
static void
fillwin(WINDOW *win, char ch)
{
@@ -6365,24 +6871,107 @@ fillwin(WINDOW *win, char ch)
}
}
+#define InCross(x,y, x1,y1) \
+ (((x > (x1 - 1) / 3) && (x <= (2 * (x1 - 1)) / 3)) \
+ || (((y > (y1 - 1) / 3) && (y <= (2 * (y1 - 1)) / 3))))
+
static void
crosswin(WINDOW *win, char ch)
{
int y, x;
int y1, x1;
+ int xw = 1;
getmaxyx(win, y1, x1);
for (y = 0; y < y1; y++) {
- for (x = 0; x < x1; x++)
- if (((x > (x1 - 1) / 3) && (x <= (2 * (x1 - 1)) / 3))
- || (((y > (y1 - 1) / 3) && (y <= (2 * (y1 - 1)) / 3)))) {
+ for (x = 0; x < x1; x += xw) {
+ if (InCross(x, y, x1, y1)) {
wmove(win, y, x);
waddch(win, UChar(ch));
}
+ }
}
}
-#define OVERLAP_FLAVORS 5
+/*
+ * Match "crosswin()", but using line-drawing characters. This could be done
+ * a little simpler using box(), but the reason for this example is to test
+ * hline/vline and addch with line-drawing vs the copy/overlay functions.
+ */
+static void
+crossbox(WINDOW *win)
+{
+ int y1, x1;
+ int ymax, xmax;
+
+ getmaxyx(win, y1, x1);
+
+ ymax = (y1 + 1);
+ xmax = (x1 + 1);
+
+ mvwhline(win, 0, (xmax / 3), ACS_HLINE, (xmax / 3));
+ mvwhline(win, ymax / 3, 0, ACS_HLINE, xmax);
+ mvwhline(win, ((2 * ymax) / 3) - 1, 0, ACS_HLINE, xmax);
+ mvwhline(win, y1 - 1, (xmax / 3), ACS_HLINE, (xmax / 3));
+
+ mvwvline(win, (ymax / 3), 0, ACS_VLINE, (ymax / 3));
+ mvwvline(win, 0, xmax / 3, ACS_VLINE, ymax);
+ mvwvline(win, 0, ((2 * xmax) / 3) - 1, ACS_VLINE, ymax);
+ mvwvline(win, (ymax / 3), x1 - 1, ACS_VLINE, (ymax / 3));
+
+ mvwaddch(win, 0, (xmax / 3), ACS_ULCORNER);
+ mvwaddch(win, 0, ((2 * xmax) / 3) - 1, ACS_URCORNER);
+ mvwaddch(win, y1 - 1, (xmax / 3), ACS_LLCORNER);
+ mvwaddch(win, y1 - 1, ((2 * xmax) / 3) - 1, ACS_LRCORNER);
+
+ mvwaddch(win, (ymax / 3), 0, ACS_ULCORNER);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, 0, ACS_LLCORNER);
+ mvwaddch(win, (ymax / 3), x1 - 1, ACS_URCORNER);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, x1 - 1, ACS_LRCORNER);
+
+ mvwaddch(win, (ymax / 3), (xmax / 3), ACS_PLUS);
+ mvwaddch(win, (ymax / 3), ((2 * xmax) / 3) - 1, ACS_PLUS);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, ((2 * xmax) / 3) - 1, ACS_PLUS);
+ mvwaddch(win, ((2 * ymax) / 3) - 1, (xmax / 3), ACS_PLUS);
+}
+
+typedef enum {
+ otBASE_refresh = 0
+ ,otBASE_fill
+ ,otBASE_draw
+ ,otBASE_clear
+ ,otBASE_copy
+} otBASE;
+
+#define OVERLAP_FLAVORS 6
+
+typedef enum {
+ otFILL_normal = 0
+ ,otFILL_bold
+ ,otFILL_color
+ ,otFILL_bright
+} otFILL;
+
+#define LimitFILL() UseColors ? 4 : 2
+
+typedef enum {
+ otDRAW_text_cross = 0
+ ,otDRAW_line_box
+ ,otDRAW_line_cross
+ ,otDRAW_set_bg
+ ,otDRAW_reset_bg
+} otDRAW;
+
+#define LimitDRAW() UseColors ? 5 : 3
+
+typedef enum {
+ otCOPY_overwrite = 0
+ ,otCOPY_merge
+ ,otCOPY_force
+ ,otCOPY_overlay
+} otCOPY;
+
+#define LimitCOPY() 4
static void
overlap_helpitem(int state, int item, char *message)
@@ -6400,18 +6989,18 @@ overlap_test_1_attr(WINDOW *win, int flavor, int col)
{
NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (1 + (flavor * 2) + col);
- switch (flavor) {
- case 0:
+ switch ((otFILL) flavor) {
+ case otFILL_normal:
(void) wattrset(win, A_NORMAL);
break;
- case 1:
+ case otFILL_bold:
(void) wattrset(win, A_BOLD);
break;
- case 2:
+ case otFILL_color:
init_pair(cpair, COLOR_BLUE, COLOR_WHITE);
(void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_NORMAL));
break;
- case 3:
+ case otFILL_bright:
init_pair(cpair, COLOR_WHITE, COLOR_BLUE);
(void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_BOLD));
break;
@@ -6423,18 +7012,21 @@ overlap_test_2_attr(WINDOW *win, int flavor, int col)
{
NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (9 + (flavor * 2) + col);
- switch (flavor) {
- case 0:
+ switch ((otDRAW) flavor) {
+ case otDRAW_text_cross:
/* no effect */
break;
- case 1:
+ case otDRAW_line_box:
/* no effect */
break;
- case 2:
+ case otDRAW_line_cross:
+ /* no effect */
+ break;
+ case otDRAW_set_bg:
init_pair(cpair, COLOR_RED, COLOR_GREEN);
wbkgdset(win, colored_chtype(' ', A_BLINK, cpair));
break;
- case 3:
+ case otDRAW_reset_bg:
wbkgdset(win, ' ' | A_NORMAL);
break;
}
@@ -6443,10 +7035,8 @@ overlap_test_2_attr(WINDOW *win, int flavor, int col)
static int
overlap_help(int state, int flavors[OVERLAP_FLAVORS])
{
- int row;
- int col;
int item;
- const char *ths, *tht;
+ int limit[OVERLAP_FLAVORS];
char msg[80];
if (state < 0)
@@ -6455,64 +7045,76 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS])
assert(state >= 0 && state < OVERLAP_FLAVORS);
for (item = 0; item < (2 * OVERLAP_FLAVORS); ++item) {
- row = item / 2;
- col = item % 2;
- ths = col ? "B" : "A";
- tht = col ? "A" : "B";
-
- switch (row) {
- case 0:
+ int row = item / 2;
+ int col = item % 2;
+ const char *ths = col ? "B" : "A";
+ const char *tht = col ? "A" : "B";
+
+ switch ((otBASE) row) {
+ case otBASE_refresh:
+ limit[row] = 1;
flavors[row] = 0;
- sprintf(msg, "refresh %s, then %s, then doupdate.", ths, tht);
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "refresh %s, then %s, then doupdate.", ths, tht);
break;
- case 1:
- if (use_colors) {
- flavors[row] %= 4;
- } else {
- flavors[row] %= 2;
- }
+ case otBASE_fill:
+ limit[row] = LimitFILL();
+ flavors[row] %= limit[row];
overlap_test_1_attr(stdscr, flavors[row], col);
- sprintf(msg, "fill window %s with letter %s.", ths, ths);
- break;
- case 2:
- if (use_colors) {
- flavors[row] %= 4;
- } else {
- flavors[row] %= 2;
- }
- switch (flavors[row]) {
- case 0:
- sprintf(msg, "cross pattern in window %s.", ths);
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "fill window %s with letter %s.", ths, ths);
+ break;
+ case otBASE_draw:
+ limit[row] = LimitDRAW();
+ flavors[row] %= limit[row];
+ switch ((otDRAW) flavors[row]) {
+ case otDRAW_text_cross:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "cross text-pattern in window %s.", ths);
break;
- case 1:
- sprintf(msg, "draw box in window %s.", ths);
+ case otDRAW_line_box:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "draw line-box in window %s.", ths);
+ break;
+ case otDRAW_line_cross:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "draw line-cross in window %s.", ths);
break;
- case 2:
- sprintf(msg, "set background of window %s.", ths);
+ case otDRAW_set_bg:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "set background of window %s.", ths);
break;
- case 3:
- sprintf(msg, "reset background of window %s.", ths);
+ case otDRAW_reset_bg:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "reset background of window %s.", ths);
break;
}
break;
- case 3:
+ case otBASE_clear:
+ limit[row] = 1;
flavors[row] = 0;
- sprintf(msg, "clear window %s.", ths);
- break;
- case 4:
- flavors[row] %= 4;
- switch (flavors[row]) {
- case 0:
- sprintf(msg, "overwrite %s onto %s.", ths, tht);
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "clear window %s.", ths);
+ break;
+ case otBASE_copy:
+ limit[row] = LimitCOPY();
+ flavors[row] %= limit[row];
+ switch ((otCOPY) flavors[row]) {
+ case otCOPY_overwrite:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "overwrite %s onto %s.", ths, tht);
break;
- case 1:
- sprintf(msg, "copywin(FALSE) %s onto %s.", ths, tht);
+ case otCOPY_merge:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "copywin(FALSE) %s onto %s.", ths, tht);
break;
- case 2:
- sprintf(msg, "copywin(TRUE) %s onto %s.", ths, tht);
+ case otCOPY_force:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "copywin(TRUE) %s onto %s.", ths, tht);
break;
- case 3:
- sprintf(msg, "overlay %s onto %s.", ths, tht);
+ case otCOPY_overlay:
+ _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+ "overlay %s onto %s.", ths, tht);
break;
}
break;
@@ -6522,8 +7124,12 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS])
wbkgdset(stdscr, ' ' | A_NORMAL);
}
move(LINES - 1, 0);
- printw("^Q/ESC = terminate test. Up/down/space select test variations (%d %d).",
- state, flavors[state]);
+ printw("^Q/ESC = terminate test. </> shift. Up/down/space select (row %d",
+ state + 1);
+ if (limit[state] > 1)
+ printw(" test %d:%d", 1 + flavors[state], limit[state]);
+ printw(").");
+ clrtoeol();
return state;
}
@@ -6550,17 +7156,20 @@ static void
overlap_test_2(int flavor, int col, WINDOW *a, char fill)
{
overlap_test_2_attr(a, flavor, col);
- switch (flavor) {
- case 0:
+ switch ((otDRAW) flavor) {
+ case otDRAW_text_cross:
crosswin(a, fill);
break;
- case 1:
+ case otDRAW_line_box:
box(a, 0, 0);
break;
- case 2:
+ case otDRAW_line_cross:
+ crossbox(a);
+ break;
+ case otDRAW_set_bg:
/* done in overlap_test_2_attr */
break;
- case 3:
+ case otDRAW_reset_bg:
/* done in overlap_test_2_attr */
break;
}
@@ -6576,44 +7185,48 @@ overlap_test_3(WINDOW *a)
static void
overlap_test_4(int flavor, WINDOW *a, WINDOW *b)
{
- switch (flavor) {
- case 0:
+ switch ((otCOPY) flavor) {
+ case otCOPY_overwrite:
overwrite(a, b);
break;
- case 1:
+ case otCOPY_merge:
copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), FALSE);
break;
- case 2:
+ case otCOPY_force:
copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), TRUE);
break;
- case 3:
+ case otCOPY_overlay:
overlay(a, b);
break;
}
}
/* test effects of overlapping windows */
-static void
-overlap_test(void)
+static int
+overlap_test(bool recur GCC_UNUSED)
{
+ WINDOW *win1, *win2;
int ch;
+ int shift = 0, last_refresh = -1;
int state, flavor[OVERLAP_FLAVORS];
- WINDOW *win1 = newwin(9, 20, 3, 3);
- WINDOW *win2 = newwin(9, 20, 9, 16);
+ if ((win1 = make_overlap(0)) == 0) {
+ return ERR;
+ } else if ((win2 = make_overlap(1)) == 0) {
+ delwin(win1);
+ return ERR;
+ }
curs_set(0);
raw();
refresh();
move(0, 0);
- printw("This test shows the behavior of wnoutrefresh() with respect to\n");
- printw("the shared region of two overlapping windows A and B. The cross\n");
- printw("pattern in each window does not overlap the other.\n");
+ printw("Test wnoutrefresh() for two overlapping windows:");
memset(flavor, 0, sizeof(flavor));
state = overlap_help(0, flavor);
- while (!isQuit(ch = Getchar()))
+ while (!isQuit(ch = Getchar(), TRUE)) {
switch (ch) {
case 'a': /* refresh window A first, then B */
overlap_test_0(win1, win2);
@@ -6624,19 +7237,19 @@ overlap_test(void)
break;
case 'c': /* fill window A so it's visible */
- overlap_test_1(flavor[1], 0, win1, 'A');
+ overlap_test_1(flavor[otBASE_fill], 0, win1, 'A');
break;
case 'd': /* fill window B so it's visible */
- overlap_test_1(flavor[1], 1, win2, 'B');
+ overlap_test_1(flavor[otBASE_fill], 1, win2, 'B');
break;
case 'e': /* cross test pattern in window A */
- overlap_test_2(flavor[2], 0, win1, 'A');
+ overlap_test_2(flavor[otBASE_draw], 0, win1, 'A');
break;
case 'f': /* cross test pattern in window A */
- overlap_test_2(flavor[2], 1, win2, 'B');
+ overlap_test_2(flavor[otBASE_draw], 1, win2, 'B');
break;
case 'g': /* clear window A */
@@ -6648,11 +7261,11 @@ overlap_test(void)
break;
case 'i': /* overwrite A onto B */
- overlap_test_4(flavor[4], win1, win2);
+ overlap_test_4(flavor[otBASE_copy], win1, win2);
break;
case 'j': /* overwrite B onto A */
- overlap_test_4(flavor[4], win2, win1);
+ overlap_test_4(flavor[otBASE_copy], win2, win1);
break;
case CTRL('n'):
@@ -6670,159 +7283,352 @@ overlap_test(void)
state = overlap_help(state, flavor);
break;
- case '?':
+ case HELP_KEY_1:
state = overlap_help(state, flavor);
break;
+ case '<':
+ /* FALLTHRU */
+ case '>':
+ /* see below */
+ break;
+
default:
beep();
break;
}
+ switch (ch) {
+ case 'a':
+ /* FALLTHRU */
+ case 'b':
+ last_refresh = ch;
+ break;
+ case '<':
+ shift -= 2;
+ /* FALLTHRU */
+ case '>':
+ shift += 1;
+ if (move_overlap(shift, win1) != OK) {
+ flash();
+ shift += (ch == '>') ? -1 : 1;
+ } else if (last_refresh > 0) {
+ clear_overlap();
+ wnoutrefresh(stdscr);
+ if (last_refresh == 'a')
+ overlap_test_0(win1, win2);
+ else
+ overlap_test_0(win2, win1);
+ }
+ break;
+ default:
+ last_refresh = -1;
+ break;
+ }
+ }
+
delwin(win2);
delwin(win1);
erase();
- curs_set(1);
- endwin();
+ stop_curses();
+ return OK;
}
-/****************************************************************************
- *
- * Main sequence
- *
- ****************************************************************************/
+#if USE_WIDEC_SUPPORT
+static void
+x_fillwin(WINDOW *win, wchar_t ch)
+{
+ int y, x;
+ int y1, x1;
-static bool
-do_single_test(const char c)
-/* perform a single specified test */
+ getmaxyx(win, y1, x1);
+ x1 /= 2;
+ for (y = 0; y < y1; y++) {
+ wmove(win, y, 0);
+ for (x = 0; x < x1; x++)
+ waddnwstr(win, &ch, 1);
+ }
+}
+
+static void
+x_crosswin(WINDOW *win, wchar_t ch)
{
- switch (c) {
- case 'a':
- getch_test();
- break;
+ int y, x;
+ int y1, x1;
+ int xw = 2;
-#if USE_WIDEC_SUPPORT
- case 'A':
- get_wch_test();
- break;
-#endif
+ getmaxyx(win, y1, x1);
+ for (y = 0; y < y1; y++) {
+ for (x = 0; x < x1; x += xw) {
+ if (InCross(x, y, x1, y1)) {
+ wmove(win, y, x);
+ waddnwstr(win, &ch, 1);
+ }
+ }
+ }
+}
- case 'b':
- attr_test();
- break;
+static void
+x_overlap_test_1(int flavor, int col, WINDOW *a, wchar_t fill)
+{
+ overlap_test_1_attr(a, flavor, col);
+ x_fillwin(a, fill);
+ (void) wattrset(a, A_NORMAL);
+}
-#if USE_WIDEC_SUPPORT
- case 'B':
- wide_attr_test();
+static void
+x_overlap_test_2(int flavor, int col, WINDOW *a, wchar_t fill)
+{
+ overlap_test_2_attr(a, flavor, col);
+ switch ((otDRAW) flavor) {
+ case otDRAW_text_cross:
+ x_crosswin(a, fill);
break;
-#endif
-
- case 'c':
- if (!use_colors)
- Cannot("does not support color.");
- else
- color_test();
+ case otDRAW_line_box:
+ box(a, 0, 0);
break;
-
-#if USE_WIDEC_SUPPORT
- case 'C':
- if (!use_colors)
- Cannot("does not support color.");
- else
- wide_color_test();
+ case otDRAW_line_cross:
+ crossbox(a);
break;
-#endif
-
- case 'd':
- if (!use_colors)
- Cannot("does not support color.");
- else if (!can_change_color())
- Cannot("has hardwired color values.");
- else
- color_edit();
+ case otDRAW_set_bg:
+ /* done in overlap_test_2_attr */
break;
-
-#if USE_SOFTKEYS
- case 'e':
- slk_test();
+ case otDRAW_reset_bg:
+ /* done in overlap_test_2_attr */
break;
+ }
+}
-#if USE_WIDEC_SUPPORT
- case 'E':
- wide_slk_test();
- break;
-#endif
-#endif
+/* test effects of overlapping windows */
+static int
+x_overlap_test(bool recur GCC_UNUSED)
+{
+ const wchar_t WIDE_A = 0xff21;
+ const wchar_t WIDE_B = 0xff22;
+ WINDOW *win1, *win2;
+ int ch;
+ int shift = 0, last_refresh = -1;
+ int state, flavor[OVERLAP_FLAVORS];
- case 'f':
- acs_display();
- break;
+ if ((win1 = make_overlap(0)) == 0) {
+ return ERR;
+ } else if ((win2 = make_overlap(1)) == 0) {
+ delwin(win1);
+ return ERR;
+ }
-#if USE_WIDEC_SUPPORT
- case 'F':
- wide_acs_display();
- break;
-#endif
+ curs_set(0);
+ raw();
+ refresh();
+ move(0, 0);
+ printw("Test wnoutrefresh() for overlapping windows with double-cell characters:");
-#if USE_LIBPANEL
- case 'o':
- demo_panels(init_panel, fill_panel);
- break;
-#endif
+ memset(flavor, 0, sizeof(flavor));
+ state = overlap_help(0, flavor);
-#if USE_WIDEC_SUPPORT && USE_LIBPANEL
- case 'O':
- demo_panels(init_wide_panel, fill_wide_panel);
- break;
-#endif
+ while (!isQuit(ch = Getchar(), TRUE)) {
+ switch (ch) {
+ case 'a': /* refresh window A first, then B */
+ overlap_test_0(win1, win2);
+ break;
- case 'g':
- acs_and_scroll();
- break;
+ case 'b': /* refresh window B first, then A */
+ overlap_test_0(win2, win1);
+ break;
- case 'i':
- flushinp_test(stdscr);
- break;
+ case 'c': /* fill window A so it's visible */
+ x_overlap_test_1(flavor[otBASE_fill], 0, win1, WIDE_A);
+ break;
- case 'k':
- test_sgr_attributes();
- break;
+ case 'd': /* fill window B so it's visible */
+ x_overlap_test_1(flavor[otBASE_fill], 1, win2, WIDE_B);
+ break;
-#if USE_LIBMENU
- case 'm':
- menu_test();
- break;
-#endif
+ case 'e': /* cross test pattern in window A */
+ x_overlap_test_2(flavor[otBASE_draw], 0, win1, WIDE_A);
+ break;
- case 'p':
- demo_pad();
- break;
+ case 'f': /* cross test pattern in window A */
+ x_overlap_test_2(flavor[otBASE_draw], 1, win2, WIDE_B);
+ break;
-#if USE_LIBFORM
- case 'r':
- demo_forms();
- break;
-#endif
+ case 'g': /* clear window A */
+ overlap_test_3(win1);
+ break;
- case 's':
- overlap_test();
- break;
+ case 'h': /* clear window B */
+ overlap_test_3(win2);
+ break;
-#if USE_LIBMENU && defined(TRACE)
- case 't':
- trace_set();
- break;
-#endif
+ case 'i': /* overwrite A onto B */
+ overlap_test_4(flavor[otBASE_copy], win1, win2);
+ break;
- case '?':
- break;
+ case 'j': /* overwrite B onto A */
+ overlap_test_4(flavor[otBASE_copy], win2, win1);
+ break;
- default:
- return FALSE;
+ case CTRL('n'):
+ case KEY_DOWN:
+ state = overlap_help(state + 1, flavor);
+ break;
+
+ case CTRL('p'):
+ case KEY_UP:
+ state = overlap_help(state - 1, flavor);
+ break;
+
+ case ' ':
+ flavor[state] += 1;
+ state = overlap_help(state, flavor);
+ break;
+
+ case HELP_KEY_1:
+ state = overlap_help(state, flavor);
+ break;
+
+ case '<':
+ /* FALLTHRU */
+ case '>':
+ /* see below */
+ break;
+
+ default:
+ beep();
+ break;
+ }
+
+ switch (ch) {
+ case 'a':
+ /* FALLTHRU */
+ case 'b':
+ last_refresh = ch;
+ break;
+ case '<':
+ shift -= 2;
+ /* FALLTHRU */
+ case '>':
+ shift += 1;
+ if (move_overlap(shift, win1) != OK) {
+ flash();
+ shift += (ch == '>') ? -1 : 1;
+ } else if (last_refresh > 0) {
+ clear_overlap();
+ wnoutrefresh(stdscr);
+ if (last_refresh == 'a')
+ overlap_test_0(win1, win2);
+ else
+ overlap_test_0(win2, win1);
+ }
+ break;
+ default:
+ last_refresh = -1;
+ break;
+ }
}
- return TRUE;
+ delwin(win2);
+ delwin(win1);
+ erase();
+ stop_curses();
+ return OK;
}
+#endif /* USE_WIDEC_SUPPORT */
+
+#endif /* HAVE_COPYWIN */
+
+static void
+show_setting_name(const char *name)
+{
+ printw("%-25s ", name);
+}
+
+static void
+show_string_setting(const char *name, const char *value)
+{
+ show_setting_name(name);
+ if (value) {
+ printw("\"%s\"", value);
+ } else {
+ attron(A_REVERSE);
+ addstr("<NULL>");
+ attroff(A_REVERSE);
+ }
+ AddCh('\n');
+}
+
+static void
+show_number_setting(const char *name, int value)
+{
+ show_setting_name(name);
+ if (value >= 0) {
+ printw("%d", value);
+ } else {
+ attron(A_REVERSE);
+ printw("%d", value);
+ attroff(A_REVERSE);
+ }
+ AddCh('\n');
+}
+
+static void
+show_boolean_setting(const char *name, int value)
+{
+ show_setting_name(name);
+ if (value >= 0) {
+ printw("%s", value ? "TRUE" : "FALSE");
+ } else {
+ attron(A_REVERSE);
+ printw("%d", value);
+ attroff(A_REVERSE);
+ }
+ AddCh('\n');
+}
+
+static int
+settings_test(bool recur GCC_UNUSED)
+{
+#if USE_WIDEC_SUPPORT
+ wchar_t ch;
+#endif
+
+ move(0, 0);
+ show_string_setting("termname", termname());
+ show_string_setting("longname", longname());
+ show_number_setting("baudrate", baudrate());
+ if (erasechar() > 0) {
+ show_string_setting("unctrl(erasechar)", unctrl((chtype) erasechar()));
+ show_string_setting("keyname(erasechar)", keyname(erasechar()));
+ }
+ if (killchar() > 0) {
+ show_string_setting("unctrl(killchar)", unctrl((chtype) killchar()));
+ show_string_setting("keyname(killchar)", keyname(killchar()));
+ }
+#if USE_WIDEC_SUPPORT
+ if (erasewchar(&ch) == OK) {
+ show_string_setting("key_name(erasewchar)", key_name(ch));
+ }
+ if (killwchar(&ch) == OK) {
+ show_string_setting("key_name(killwchar)", key_name(ch));
+ }
+#endif
+ show_boolean_setting("has_ic", has_ic());
+ show_boolean_setting("has_il", has_il());
+ show_boolean_setting("has_colors", has_colors());
+#if HAVE_COLOR_CONTENT
+ show_boolean_setting("can_change_color", can_change_color());
+#endif
+ Pause();
+ erase();
+ stop_curses();
+ return OK;
+}
+
+/****************************************************************************
+ *
+ * Main sequence
+ *
+ ****************************************************************************/
static void
usage(void)
@@ -6847,16 +7653,21 @@ usage(void)
," -h rip-off header line (can repeat)"
#endif
," -m do not use colors"
+#if HAVE_COLOR_CONTENT
," -p file rgb values to use in 'd' rather than ncurses's builtin"
+#endif
#if USE_LIBPANEL
," -s msec specify nominal time for panel-demo (default: 1, to hold)"
#endif
-#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(__MINGW32__)
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(_WIN32)
," -T call use_tioctl(TRUE) to allow SIGWINCH to override environment"
#endif
#ifdef TRACE
," -t mask specify default trace-level (may toggle with ^T)"
#endif
+#if HAVE_COLOR_CONTENT
+ ," -x use xterm-compatible control for reading color palette"
+#endif
};
size_t n;
for (n = 0; n < SIZEOF(tbl); n++)
@@ -6910,56 +7721,85 @@ rip_header(WINDOW *win, int cols)
static void
main_menu(bool top)
{
- char command;
-
- do {
- (void) puts("This is the ncurses main menu");
- (void) puts("a = keyboard and mouse input test");
#if USE_WIDEC_SUPPORT
- (void) puts("A = wide-character keyboard and mouse input test");
-#endif
- (void) puts("b = character attribute test");
-#if USE_WIDEC_SUPPORT
- (void) puts("B = wide-character attribute test");
+ typedef struct {
+ bool recur;
+ int (*narrow_func) (bool);
+ int (*wide_func) (bool);
+ int code;
+ const char *help;
+ } MyCmds;
+#define BOTH(a) a, x_ ## a
+#define ONLY(a) a, NULL
+#define CMDS(recur, funcs,code,help) { recur, funcs, code, help }
+#else
+ typedef struct {
+ bool recur;
+ int (*narrow_func) (bool);
+ int code;
+ const char *help;
+ } MyCmds;
+#define BOTH(a) a
+#define ONLY(a) a
+#define CMDS(recur, funcs,code,help) { recur, funcs, code, help }
#endif
- (void) puts("c = color test pattern");
-#if USE_WIDEC_SUPPORT
- (void) puts("C = color test pattern using wide-character calls");
+ /* *INDENT-OFF* */
+ static MyCmds cmds[] =
+ {
+ CMDS(TRUE, BOTH(getch_test), 'a', "keyboard and mouse input test"),
+ CMDS(TRUE, BOTH(attr_test), 'b', "character attribute test"),
+ CMDS(TRUE, BOTH(color_test), 'c', "color test pattern"),
+#if HAVE_COLOR_CONTENT
+ CMDS(FALSE, ONLY(color_edit), 'd', "edit RGB color values"),
#endif
- if (top)
- (void) puts("d = edit RGB color values");
#if USE_SOFTKEYS
- (void) puts("e = exercise soft keys");
-#if USE_WIDEC_SUPPORT
- (void) puts("E = exercise soft keys using wide-characters");
-#endif
-#endif
- (void) puts("f = display ACS characters");
-#if USE_WIDEC_SUPPORT
- (void) puts("F = display Wide-ACS characters");
+ CMDS(TRUE, BOTH(slk_test), 'e', "exercise soft keys"),
#endif
- (void) puts("g = display windows and scrolling");
- (void) puts("i = test of flushinp()");
- (void) puts("k = display character attributes");
+ CMDS(TRUE, BOTH(acs_test), 'f', "display ACS characters"),
+ CMDS(TRUE, ONLY(scroll_test), 'g', "display windows and scrolling"),
+ CMDS(TRUE, ONLY(flushinp_test), 'i', "test flushinp()"),
+ CMDS(TRUE, ONLY(sgr_attr_test), 'k', "display character attributes"),
#if USE_LIBMENU
- (void) puts("m = menu code test");
+ CMDS(TRUE, ONLY(menu_test), 'm', "exercise menu library"),
#endif
#if USE_LIBPANEL
- (void) puts("o = exercise panels library");
-#if USE_WIDEC_SUPPORT
- (void) puts("O = exercise panels with wide-characters");
+ CMDS(TRUE, BOTH(panel_test), 'o', "exercise panel library"),
#endif
+#if HAVE_NEWPAD
+ CMDS(TRUE, ONLY(pad_test), 'p', "exercise pad features"),
#endif
- (void) puts("p = exercise pad features");
- (void) puts("q = quit");
-#if USE_LIBFORM
- (void) puts("r = exercise forms code");
+ CMDS(TRUE, ONLY(NULL), 'q', "quit"),
+#if USE_LIBMENU
+ CMDS(TRUE, ONLY(form_test), 'r', "exercise form library"),
+#endif
+#if HAVE_COPYWIN
+ CMDS(TRUE, BOTH(overlap_test), 's', "overlapping-refresh test"),
#endif
- (void) puts("s = overlapping-refresh test");
#if USE_LIBMENU && defined(TRACE)
- (void) puts("t = set trace level");
+ CMDS(TRUE, ONLY(trace_set), 't', "set trace level"),
+#endif
+ CMDS(TRUE, ONLY(settings_test), 'v', "show terminal name and settings"),
+ CMDS(FALSE, ONLY(NULL), '?', "repeat this command summary")
+ };
+ /* *INDENT-ON* */
+
+ int (*doit) (bool);
+ char command;
+ unsigned n;
+
+ do {
+ printf("This is the ncurses main menu (uppercase for wide-characters)\n");
+ for (n = 0; n < SIZEOF(cmds); ++n) {
+ if (top || cmds[n].recur) {
+ putchar(' ');
+#if USE_WIDEC_SUPPORT
+ if (cmds[n].wide_func) {
+ printf("%c,", toupper(cmds[n].code));
+ }
#endif
- (void) puts("? = repeat this command summary");
+ printf("%c\t= %s\n", cmds[n].code, cmds[n].help);
+ }
+ }
(void) fputs("> ", stdout);
(void) fflush(stdout); /* necessary under SVr4 curses */
@@ -6973,8 +7813,14 @@ main_menu(bool top)
for (;;) {
char ch = '\0';
if (read(fileno(stdin), &ch, (size_t) 1) <= 0) {
- if (command == 0)
+ int save_err = errno;
+ perror("\nOOPS");
+ if (save_err == EINTR) {
+ clearerr(stdin);
+ continue;
+ } else if (command == 0) {
command = 'q';
+ }
break;
} else if (command == 0 && !isspace(UChar(ch))) {
command = ch;
@@ -6990,7 +7836,21 @@ main_menu(bool top)
}
}
- if (do_single_test(command)) {
+ doit = NULL;
+ for (n = 0; n < SIZEOF(cmds); ++n) {
+ if (cmds[n].code == command) {
+ doit = cmds[n].narrow_func;
+ break;
+ }
+#if USE_WIDEC_SUPPORT
+ if (toupper(cmds[n].code) == command) {
+ doit = cmds[n].wide_func;
+ break;
+ }
+#endif
+ }
+
+ if (doit != NULL && doit(FALSE) == OK) {
/*
* This may be overkill; it's intended to reset everything back
* to the initial terminal modes so that tests don't get in
@@ -7021,28 +7881,34 @@ main_menu(bool top)
main(argc,argv)
--------------------------------------------------------------------------*/
-#define okCOLOR(n) ((n) >= 0 && (n) < max_colors)
-#define okRGB(n) ((n) >= 0 && (n) <= 1000)
-
int
main(int argc, char *argv[])
{
int c;
int my_e_param = 1;
-#ifdef NCURSES_VERSION
+#ifdef NCURSES_VERSION_PATCH
+#if HAVE_USE_DEFAULT_COLORS
int default_fg = COLOR_WHITE;
int default_bg = COLOR_BLACK;
- bool assumed_colors = FALSE;
bool default_colors = FALSE;
+#if HAVE_ASSUME_DEFAULT_COLORS
+ bool assumed_colors = FALSE;
+#endif
+#endif
#endif
- char *palette_file = 0;
bool monochrome = FALSE;
+#if HAVE_COLOR_CONTENT
+ bool xterm_colors = FALSE;
+ char *palette_file = 0;
+#endif
setlocale(LC_ALL, "");
- while ((c = getopt(argc, argv, "a:dEe:fhmp:s:Tt:")) != -1) {
+ while ((c = getopt(argc, argv, "a:dEe:fhmp:s:Tt:x")) != -1) {
switch (c) {
-#ifdef NCURSES_VERSION
+#ifdef NCURSES_VERSION_PATCH
+#if HAVE_USE_DEFAULT_COLORS
+#if HAVE_ASSUME_DEFAULT_COLORS
case 'a':
assumed_colors = TRUE;
switch (sscanf(optarg, "%d,%d", &default_fg, &default_bg)) {
@@ -7054,10 +7920,12 @@ main(int argc, char *argv[])
break;
}
break;
+#endif
case 'd':
default_colors = TRUE;
break;
#endif
+#endif
#if HAVE_USE_ENV
case 'E':
use_env(FALSE);
@@ -7084,15 +7952,17 @@ main(int argc, char *argv[])
case 'm':
monochrome = TRUE;
break;
+#if HAVE_COLOR_CONTENT
case 'p':
palette_file = optarg;
break;
+#endif
#if USE_LIBPANEL
case 's':
nap_msec = (int) atol(optarg);
break;
#endif
-#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(__MINGW32__)
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20120714) && !defined(_WIN32)
case 'T':
use_tioctl(TRUE);
break;
@@ -7102,6 +7972,11 @@ main(int argc, char *argv[])
save_trace = (unsigned) strtol(optarg, 0, 0);
break;
#endif
+#if HAVE_COLOR_CONTENT
+ case 'x':
+ xterm_colors = TRUE;
+ break;
+#endif
default:
usage();
}
@@ -7115,10 +7990,10 @@ main(int argc, char *argv[])
#ifdef TRACE
/* enable debugging */
#if !USE_LIBMENU
- trace(save_trace);
+ curses_trace(save_trace);
#else
if (!isatty(fileno(stdin)))
- trace(save_trace);
+ curses_trace(save_trace);
#endif /* USE_LIBMENU */
#endif /* TRACE */
@@ -7136,17 +8011,20 @@ main(int argc, char *argv[])
initscr();
bkgdset(BLANK);
+ set_terminal_modes();
+ def_prog_mode();
+
/* tests, in general, will want these modes */
- use_colors = (bool) (monochrome ? FALSE : has_colors());
+ UseColors = (bool) (monochrome ? FALSE : has_colors());
- if (use_colors) {
+ if (UseColors) {
start_color();
#ifdef NCURSES_VERSION_PATCH
- max_colors = COLORS; /* was > 16 ? 16 : COLORS */
+ MaxColors = COLORS; /* was > 16 ? 16 : COLORS */
#if HAVE_USE_DEFAULT_COLORS
if (default_colors) {
use_default_colors();
- min_colors = -1;
+ MinColors = -1;
}
#if HAVE_ASSUME_DEFAULT_COLORS
if (assumed_colors)
@@ -7154,52 +8032,16 @@ main(int argc, char *argv[])
#endif
#endif
#else /* normal SVr4 curses */
- max_colors = COLORS; /* was > 8 ? 8 : COLORS */
+ MaxColors = COLORS; /* was > 8 ? 8 : COLORS */
#endif
max_pairs = COLOR_PAIRS; /* was > 256 ? 256 : COLOR_PAIRS */
+#if HAVE_COLOR_CONTENT
if (can_change_color()) {
- NCURSES_PAIRS_T cp;
- all_colors = typeMalloc(RGB_DATA, (unsigned) max_colors);
- if (!all_colors)
- failed("all_colors");
- for (cp = 0; cp < max_colors; ++cp) {
- color_content(cp,
- &all_colors[cp].red,
- &all_colors[cp].green,
- &all_colors[cp].blue);
- }
- if (palette_file != 0) {
- FILE *fp = fopen(palette_file, "r");
- if (fp != 0) {
- char buffer[BUFSIZ];
- int red, green, blue;
- int scale = 1000;
- while (fgets(buffer, sizeof(buffer), fp) != 0) {
- if (sscanf(buffer, "scale:%d", &c) == 1) {
- scale = c;
- } else if (sscanf(buffer, "%d:%d %d %d",
- &c,
- &red,
- &green,
- &blue) == 4
- && okCOLOR(c)
- && okRGB(red)
- && okRGB(green)
- && okRGB(blue)) {
-#define Scaled(n) (NCURSES_COLOR_T) (((n) * 1000) / scale)
- all_colors[c].red = Scaled(red);
- all_colors[c].green = Scaled(green);
- all_colors[c].blue = Scaled(blue);
- }
- }
- fclose(fp);
- }
- }
+ init_all_colors(xterm_colors, palette_file);
}
+#endif
}
- set_terminal_modes();
- def_prog_mode();
/*
* Return to terminal mode, so we're guaranteed of being able to
diff --git a/test/ncurses_tst.hin b/test/ncurses_tst.hin
index 1d77cbd..238fc22 100644
--- a/test/ncurses_tst.hin
+++ b/test/ncurses_tst.hin
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998 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 +31,7 @@
* Author: Thomas E. Dickey <dickey@clark.net> 1998 *
****************************************************************************/
/*
- * $Id: ncurses_tst.hin,v 1.2 1998/02/11 12:14:05 tom Exp $
+ * $Id: ncurses_tst.hin,v 1.3 2020/02/02 23:34:34 tom Exp $
*
* This is a template-file used to generate the "ncurses_cfg.h" file.
*
diff --git a/test/newdemo.c b/test/newdemo.c
index f9b6f82..d76523a 100644
--- a/test/newdemo.c
+++ b/test/newdemo.c
@@ -2,7 +2,7 @@
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
- * $Id: newdemo.c,v 1.41 2014/08/02 23:10:56 tom Exp $
+ * $Id: newdemo.c,v 1.47 2019/12/14 23:25:29 tom Exp $
*/
#include <test.priv.h>
@@ -50,7 +50,7 @@ static const char *messages[] =
static void
trap(int sig GCC_UNUSED)
{
- endwin();
+ stop_curses();
ExitProgram(EXIT_FAILURE);
}
@@ -61,11 +61,12 @@ static int
WaitForUser(WINDOW *win)
{
time_t t;
- chtype key;
nodelay(win, TRUE);
t = time((time_t *) 0);
+
while (1) {
+ chtype key;
if ((int) (key = (chtype) wgetch(win)) != ERR) {
if (key == 'q' || key == 'Q')
return 1;
@@ -221,18 +222,14 @@ int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
WINDOW *win;
- int w, x, y, i, j, k;
+ int x, y, i, k;
char buffer[SIZEOF(messages) * 80];
- const char *message;
int width, height;
chtype save[80];
- chtype c;
setlocale(LC_ALL, "");
- CATCHALL(trap);
-
- initscr();
+ InitAndCatch(initscr(), trap);
if (has_colors())
start_color();
cbreak();
@@ -241,11 +238,16 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
height = 14; /* Create a drawing window */
win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
if (win == NULL) {
- endwin();
+ stop_curses();
ExitProgram(EXIT_FAILURE);
}
while (1) {
+ int w;
+ int j;
+ chtype c;
+ const char *message;
+
set_colors(win, 1, COLOR_WHITE, COLOR_BLUE);
werase(win);
@@ -299,11 +301,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
message = messages[j = 0];
i = 1;
w = width - 2;
- strcpy(buffer, message);
+ _nc_STRCPY(buffer, message, sizeof(buffer));
while (j < NMESSAGES) {
while ((int) strlen(buffer) < w) {
- strcat(buffer, " ... ");
- strcat(buffer, messages[++j % NMESSAGES]);
+ _nc_STRCAT(buffer, " ... ", sizeof(buffer));
+ _nc_STRCAT(buffer, messages[++j % NMESSAGES], sizeof(buffer));
}
if (i < w)
@@ -360,6 +362,6 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (WaitForUser(win) == 1)
break;
}
- endwin();
+ stop_curses();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/package/debian-mingw/compat b/test/package/debian-mingw/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/test/package/debian-mingw/compat
@@ -0,0 +1 @@
+9
diff --git a/test/package/debian-mingw/control b/test/package/debian-mingw/control
new file mode 100644
index 0000000..64bd01b
--- /dev/null
+++ b/test/package/debian-mingw/control
@@ -0,0 +1,18 @@
+Source: ncurses-examples
+Maintainer: Thomas E. Dickey <dickey@invisible-island.net>
+Section: misc
+Priority: optional
+Standards-Version: 3.8.4
+Build-Depends: debhelper (>= 5)
+Homepage: https://invisible-island.net/ncurses/ncurses-examples.html
+
+Package: mingw32-ncurses-examples
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: example/test programs from ncurses
+ These are the example/test programs from the ncurses distribution.
+ .
+ This package is used for testing ABI 6 with the MinGW 32-bit port.
+ .
+ This package installs in "bin/ncurses-examples" to avoid conflict with other
+ packages.
diff --git a/test/package/debian-mingw/copyright b/test/package/debian-mingw/copyright
new file mode 100644
index 0000000..9b2b7aa
--- /dev/null
+++ b/test/package/debian-mingw/copyright
@@ -0,0 +1,78 @@
+Upstream source https://invisible-island.net/ncurses/ncurses-examples.html
+
+Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
+
+-------------------------------------------------------------------------------
+Files: *
+Copyright: 1998-2019,2020 Free Software Foundation, Inc.
+Licence: X11
+
+Files: aclocal.m4 package
+Copyright: 2003-2019,2020 by Thomas E. Dickey
+Licence: X11
+
+ 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.
+
+-------------------------------------------------------------------------------
+Files: install-sh
+Copyright: 1994 X Consortium
+Licence: X11
+
+ 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, 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
+ X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+ TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of the X Consortium shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from the X Consor-
+ tium.
+
+ FSF changes to this file are in the public domain.
+
+ Calling this script install-sh is preferred over install.sh, to prevent
+ `make' implicit rules from creating a file called install from it
+ when there is no Makefile.
+
+ This script is compatible with the BSD install script, but was written
+ from scratch. It can only install one file at a time, a restriction
+ shared with many OS's install programs.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in '/usr/share/common-licenses/GPL-2'
+
+-- vile: txtmode file-encoding=utf-8
diff --git a/test/package/debian-mingw/docs b/test/package/debian-mingw/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/test/package/debian-mingw/docs
@@ -0,0 +1 @@
+README
diff --git a/test/package/debian-mingw/rules b/test/package/debian-mingw/rules
new file mode 100755
index 0000000..e61cf71
--- /dev/null
+++ b/test/package/debian-mingw/rules
@@ -0,0 +1,101 @@
+#!/usr/bin/make -f
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
+CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
+
+NCURSES_PKG = ncurses-examples
+
+TARGET = i686-w64-mingw32
+MINGW_BIN = /usr/bin
+MINGW_TOP = /usr/$(TARGET)
+MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses-examples
+
+CFLAGS = $(CC_NORMAL)
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+
+ CFLAGS="$(CFLAGS)" ./configure \
+ --host=$(TARGET) \
+ --target=$(TARGET) \
+ --prefix=$(MINGW_TOP) \
+ --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
+ --datadir=\$${prefix}/share/$(NCURSES_PKG) \
+ --with-screen=ncursesw6 \
+ --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig
+
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+
+ $(MAKE)
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+
+ [ ! -f makefile ] || $(MAKE) distclean
+
+ rm -f configure-stamp build-stamp install-stamp
+
+ dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ $(MAKE) install DESTDIR=$(MINGW_TMP)
+
+ touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# No binary-indep target.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installexamples
+ dh_installchangelogs NEWS
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install install-stamp
diff --git a/test/package/debian-mingw/source/format b/test/package/debian-mingw/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/test/package/debian-mingw/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/test/package/debian-mingw/watch b/test/package/debian-mingw/watch
new file mode 100644
index 0000000..ec075b1
--- /dev/null
+++ b/test/package/debian-mingw/watch
@@ -0,0 +1,4 @@
+version=3
+
+opts=passive ftp://ftp.invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \
+ debian uupdate
diff --git a/test/package/debian-mingw64/compat b/test/package/debian-mingw64/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/test/package/debian-mingw64/compat
@@ -0,0 +1 @@
+9
diff --git a/test/package/debian-mingw64/control b/test/package/debian-mingw64/control
new file mode 100644
index 0000000..c22f262
--- /dev/null
+++ b/test/package/debian-mingw64/control
@@ -0,0 +1,18 @@
+Source: ncurses-examples
+Maintainer: Thomas E. Dickey <dickey@invisible-island.net>
+Section: misc
+Priority: optional
+Standards-Version: 3.8.4
+Build-Depends: debhelper (>= 5)
+Homepage: https://invisible-island.net/ncurses/ncurses-examples.html
+
+Package: mingw64-ncurses-examples
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: example/test programs from ncurses
+ These are the example/test programs from the ncurses distribution.
+ .
+ This package is used for testing ABI 6 with the MinGW 64-bit port.
+ .
+ This package installs in "bin/ncurses-examples" to avoid conflict with other
+ packages.
diff --git a/test/package/debian-mingw64/copyright b/test/package/debian-mingw64/copyright
new file mode 100644
index 0000000..9b2b7aa
--- /dev/null
+++ b/test/package/debian-mingw64/copyright
@@ -0,0 +1,78 @@
+Upstream source https://invisible-island.net/ncurses/ncurses-examples.html
+
+Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
+
+-------------------------------------------------------------------------------
+Files: *
+Copyright: 1998-2019,2020 Free Software Foundation, Inc.
+Licence: X11
+
+Files: aclocal.m4 package
+Copyright: 2003-2019,2020 by Thomas E. Dickey
+Licence: X11
+
+ 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.
+
+-------------------------------------------------------------------------------
+Files: install-sh
+Copyright: 1994 X Consortium
+Licence: X11
+
+ 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, 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
+ X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+ TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ Except as contained in this notice, the name of the X Consortium shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from the X Consor-
+ tium.
+
+ FSF changes to this file are in the public domain.
+
+ Calling this script install-sh is preferred over install.sh, to prevent
+ `make' implicit rules from creating a file called install from it
+ when there is no Makefile.
+
+ This script is compatible with the BSD install script, but was written
+ from scratch. It can only install one file at a time, a restriction
+ shared with many OS's install programs.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in '/usr/share/common-licenses/GPL-2'
+
+-- vile: txtmode file-encoding=utf-8
diff --git a/test/package/debian-mingw64/docs b/test/package/debian-mingw64/docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/test/package/debian-mingw64/docs
@@ -0,0 +1 @@
+README
diff --git a/test/package/debian-mingw64/rules b/test/package/debian-mingw64/rules
new file mode 100755
index 0000000..7db9c5a
--- /dev/null
+++ b/test/package/debian-mingw64/rules
@@ -0,0 +1,101 @@
+#!/usr/bin/make -f
+# Made with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
+CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
+
+NCURSES_PKG = ncurses-examples
+
+TARGET = x86_64-w64-mingw32
+MINGW_BIN = /usr/bin
+MINGW_TOP = /usr/$(TARGET)
+MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses-examples
+
+CFLAGS = $(CC_NORMAL)
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+
+ CFLAGS="$(CFLAGS)" ./configure \
+ --host=$(TARGET) \
+ --target=$(TARGET) \
+ --prefix=$(MINGW_TOP) \
+ --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
+ --datadir=\$${prefix}/share/$(NCURSES_PKG) \
+ --with-screen=ncursesw6 \
+ --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig
+
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+
+ $(MAKE)
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+
+ [ ! -f makefile ] || $(MAKE) distclean
+
+ rm -f configure-stamp build-stamp install-stamp
+
+ dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ $(MAKE) install DESTDIR=$(MINGW_TMP)
+
+ touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# No binary-indep target.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installexamples
+ dh_installchangelogs NEWS
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install install-stamp
diff --git a/test/package/debian-mingw64/source/format b/test/package/debian-mingw64/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/test/package/debian-mingw64/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/test/package/debian-mingw64/watch b/test/package/debian-mingw64/watch
new file mode 100644
index 0000000..ec075b1
--- /dev/null
+++ b/test/package/debian-mingw64/watch
@@ -0,0 +1,4 @@
+version=3
+
+opts=passive ftp://ftp.invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \
+ debian uupdate
diff --git a/test/package/debian/compat b/test/package/debian/compat
index 7ed6ff8..ec63514 100644
--- a/test/package/debian/compat
+++ b/test/package/debian/compat
@@ -1 +1 @@
-5
+9
diff --git a/test/package/debian/control b/test/package/debian/control
index 520ad42..d7647b3 100644
--- a/test/package/debian/control
+++ b/test/package/debian/control
@@ -4,13 +4,23 @@ Section: misc
Priority: optional
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 5)
-Homepage: http://invisible-island.net/ncurses/ncurses-examples.html
+Homepage: https://invisible-island.net/ncurses/ncurses-examples.html
Package: ncurses-examples
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: ncurses-examples - example/test programs from ncurses
+Description: example/test programs from ncurses
These are the example/test programs from the ncurses distribution.
.
This package installs in "bin/ncurses-examples" to avoid conflict with other
packages.
+
+Package: ncursest-examples
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: example/test programs from ncurses
+ These are the example/test programs from the ncurses distribution, using
+ the thread configuration.
+ .
+ This package installs in "bin/ncursest-examples" to avoid conflict with other
+ packages.
diff --git a/test/package/debian/copyright b/test/package/debian/copyright
index e681a6b..9b2b7aa 100644
--- a/test/package/debian/copyright
+++ b/test/package/debian/copyright
@@ -1,9 +1,15 @@
-Upstream source http://invisible-island.net/ncurses/ncurses-examples.html
+Upstream source https://invisible-island.net/ncurses/ncurses-examples.html
Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
-------------------------------------------------------------------------------
- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.
+Files: *
+Copyright: 1998-2019,2020 Free Software Foundation, Inc.
+Licence: X11
+
+Files: aclocal.m4 package
+Copyright: 2003-2019,2020 by Thomas E. Dickey
+Licence: X11
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -28,11 +34,12 @@ Current ncurses maintainer: Thomas Dickey <dickey@invisible-island.net>
holders shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization.
--------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
Files: install-sh
Copyright: 1994 X Consortium
-Licence: other-BSD
+Licence: X11
+
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
@@ -67,3 +74,5 @@ Licence: other-BSD
On Debian systems, the complete text of the GNU General
Public License can be found in '/usr/share/common-licenses/GPL-2'
+
+-- vile: txtmode file-encoding=utf-8
diff --git a/test/package/debian/rules b/test/package/debian/rules
index 4d4146b..4e6d570 100755
--- a/test/package/debian/rules
+++ b/test/package/debian/rules
@@ -1,17 +1,26 @@
#!/usr/bin/make -f
-# MAde with the aid of dh_make, by Craig Small
+# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# packages
+NCURSES_PKG = ncurses-examples
+NCURSEST_PKG = ncursest-examples
+
+PACKAGES.indep = # ncurses-examples-docs
+PACKAGES.arch = $(NCURSES_PKG) $(NCURSEST_PKG)
+
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-CFLAGS =
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
@@ -22,69 +31,134 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
+verbose = # -v
-configure: configure-stamp
-configure-stamp:
- dh_testdir
-
- CFLAGS="$(CFLAGS)" ./configure \
+configure = \
+ CFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" ../../configure \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
- --bindir=\$${prefix}/bin/ncurses-examples \
--prefix=/usr \
- --with-ncursesw \
--disable-rpath-hack
- touch configure-stamp
+.PHONY: all config build install binary clean config-indep config-arch \
+ build-indep build-arch install-indep install-arch binary-indep \
+ binary-arch
+
+all: build
-build: build-stamp
-build-stamp: configure-stamp
+config: config-indep config-arch
+build: build-indep build-arch
+install: install-indep install-arch
+binary: binary-indep binary-arch
+clean:
dh_testdir
+ dh_testroot
+ dh_clean $(verbose)
+ rm -rf t
- $(MAKE)
+config-indep: $(PACKAGES.indep:%=config-%-stamp)
+config-arch: $(PACKAGES.arch:%=config-%-stamp)
- touch build-stamp
+build-indep: $(PACKAGES.indep:%=build-%-stamp)
+build-arch: $(PACKAGES.arch:%=build-%-stamp)
-clean:
+install-indep: $(PACKAGES.indep:%=install-%-stamp)
+install-arch: $(PACKAGES.arch:%=install-%-stamp)
+
+config-$(NCURSES_PKG)-stamp:
dh_testdir
- dh_testroot
- [ ! -f makefile ] || $(MAKE) distclean
+ rm -rf t/ncurses6
+ mkdir -p t/ncurses6
- rm -f configure-stamp build-stamp install-stamp
+ cd t/ncurses6; $(configure) \
+ --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
+ --datadir=\$${prefix}/share/$(NCURSES_PKG) \
+ --with-screen=ncursesw6
- dh_clean
+ touch $@
-install: install-stamp
-install-stamp: build-stamp
+config-$(NCURSEST_PKG)-stamp:
+ dh_testdir
+
+ rm -rf t/ncursest6
+ mkdir -p t/ncursest6
+
+ cd t/ncursest6; $(configure) \
+ --bindir=\$${prefix}/bin/$(NCURSEST_PKG) \
+ --datadir=\$${prefix}/share/$(NCURSEST_PKG) \
+ --with-screen=ncursestw6
+
+ touch $@
+
+build-$(NCURSES_PKG)-stamp: config-$(NCURSES_PKG)-stamp
+ dh_testdir
+
+ $(MAKE) -C t/ncurses6
+
+ touch $@
+
+build-$(NCURSEST_PKG)-stamp: config-$(NCURSEST_PKG)-stamp
+ dh_testdir
+
+ $(MAKE) -C t/ncursest6
+
+ touch $@
+
+install-$(NCURSES_PKG)-stamp: build-$(NCURSES_PKG)-stamp
dh_testdir
dh_testroot
- dh_clean -k
- dh_installdirs
+ dh_installdirs $(verbose)
+ dh_prep $(verbose) -p$(NCURSES_PKG)
+
+ $(MAKE) -C t/ncurses6 install DESTDIR=$(CURDIR)/debian/$(NCURSES_PKG)
- $(MAKE) install DESTDIR=$(CURDIR)/debian/ncurses-examples
+ touch $@
- touch install-stamp
+install-$(NCURSEST_PKG)-stamp: build-$(NCURSEST_PKG)-stamp
+ dh_testdir
+ dh_testroot
+ dh_installdirs $(verbose)
+ dh_prep $(verbose) -p$(NCURSEST_PKG)
+
+ $(MAKE) -C t/ncursest6 install DESTDIR=$(CURDIR)/debian/$(NCURSEST_PKG)
+
+ touch $@
# Build architecture-independent files here.
-binary-indep: build install
-# No binary-indep target.
+binary-indep: install-indep
+ifneq ($(PACKAGES.indep),)
+ rm -f $(PACKAGES.indep:%=install-%-stamp)
+ dh_testdir
+ dh_testroot
+ dh_installdocs $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_installman $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_installexamples $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) NEWS
+ dh_compress $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_fixperms $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_installdeb $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_gencontrol $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_md5sums $(verbose) $(PACKAGES.indep:%=-p%)
+ dh_builddeb $(verbose) $(PACKAGES.indep:%=-p%)
+endif
# Build architecture-dependent files here.
-binary-arch: build install
+binary-arch: install-arch
+ifneq ($(PACKAGES.arch),)
+ rm -f $(PACKAGES.arch:%=install-%-stamp)
dh_testdir
dh_testroot
- dh_installdocs
- dh_installexamples
- dh_installchangelogs NEWS
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install install-stamp
+ dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) NEWS
+ dh_strip $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_compress $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_makeshlibs $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%)
+ dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%)
+endif
diff --git a/test/package/debian/source/format b/test/package/debian/source/format
index 163aaf8..89ae9db 100644
--- a/test/package/debian/source/format
+++ b/test/package/debian/source/format
@@ -1 +1 @@
-3.0 (quilt)
+3.0 (native)
diff --git a/test/package/debian/watch b/test/package/debian/watch
index 1d08098..ec075b1 100644
--- a/test/package/debian/watch
+++ b/test/package/debian/watch
@@ -1,4 +1,4 @@
version=3
-opts=passive ftp://invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \
+opts=passive ftp://ftp.invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \
debian uupdate
diff --git a/test/package/mingw-ncurses-examples.spec b/test/package/mingw-ncurses-examples.spec
index fdc2a69..5758c29 100644
--- a/test/package/mingw-ncurses-examples.spec
+++ b/test/package/mingw-ncurses-examples.spec
@@ -1,17 +1,17 @@
Summary: ncurses-examples - example/test programs from ncurses
%?mingw_package_header
-%define AppProgram ncurses-examples
-%define AppVersion MAJOR.MINOR
-%define AppRelease YYYYMMDD
-# $Id: mingw-ncurses-examples.spec,v 1.3 2013/10/26 23:30:21 tom Exp $
+%global AppProgram ncurses-examples
+%global AppVersion MAJOR.MINOR
+%global AppRelease YYYYMMDD
+# $Id: mingw-ncurses-examples.spec,v 1.9 2019/11/23 21:13:52 tom Exp $
Name: mingw32-ncurses6-examples
Version: %{AppVersion}
Release: %{AppRelease}
License: X11
Group: Development/Libraries
Source: ncurses-examples-%{release}.tgz
-# URL: http://invisible-island.net/ncurses/
+# URL: https://invisible-island.net/ncurses/
BuildRequires: mingw32-ncurses6
@@ -53,10 +53,14 @@ This package is used for testing ABI 6 with cross-compiles to MinGW.
%global mingw32_bindir %{mingw32_exec_prefix}/bin/%{AppProgram}
%global mingw64_bindir %{mingw64_exec_prefix}/bin/%{AppProgram}
+%global mingw32_datadir %{mingw32_datadir}/%{AppProgram}
+%global mingw64_datadir %{mingw64_datadir}/%{AppProgram}
+
%define CFG_OPTS \\\
- --disable-echo \\\
- --enable-warnings \\\
- --verbose
+ --enable-echo \\\
+ --enable-warnings \\\
+ --verbose \\\
+ --with-screen=ncursesw6
%define debug_package %{nil}
%setup -q -n ncurses-examples-%{release}
@@ -66,8 +70,9 @@ mkdir BUILD-W32
pushd BUILD-W32
CFLAGS="%{CC_NORMAL}" \
CC=%{mingw32_cc} \
-%mingw32_configure %{CFG_OPTS}
-cp config.status /tmp/ming32-config.status
+NCURSES_CONFIG_SUFFIX=dev \
+%mingw32_configure %{CFG_OPTS} \
+ --datadir=%{mingw32_datadir}
make
popd
@@ -75,8 +80,8 @@ mkdir BUILD-W64
pushd BUILD-W64
CFLAGS="%{CC_NORMAL}" \
CC=%{mingw64_cc} \
-%mingw64_configure %{CFG_OPTS}
-cp config.status /tmp/ming64-config.status
+%mingw64_configure %{CFG_OPTS} \
+ --datadir=%{mingw32_datadir}
make
popd
@@ -92,18 +97,27 @@ pushd BUILD-W64
popd
%clean
-rm -rf $RPM_BUILD_ROOT
+if rm -rf $RPM_BUILD_ROOT; then
+ echo OK
+else
+ find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
+fi
+exit 0
-%files
%defattr(-,root,root,-)
%files -n mingw32-ncurses6-examples
%{mingw32_bindir}/*
+%{mingw32_datadir}/*
%files -n mingw64-ncurses6-examples
%{mingw64_bindir}/*
+%{mingw64_datadir}/*
%changelog
+* Sat Nov 16 2019 Thomas Dickey
+- modify clean-rule to work around Fedora NFS bugs.
+
* Sat Oct 19 2013 Thomas E. Dickey
- initial version
diff --git a/test/package/ncurses-examples.spec b/test/package/ncurses-examples.spec
index 8a01678..d2b5a84 100644
--- a/test/package/ncurses-examples.spec
+++ b/test/package/ncurses-examples.spec
@@ -1,14 +1,15 @@
-Summary: ncurses-examples - example/test programs from ncurses
-%define AppProgram ncurses-examples
-%define AppVersion MAJOR.MINOR
-%define AppRelease YYYYMMDD
-# $Id: ncurses-examples.spec,v 1.3 2013/10/05 23:44:19 tom Exp $
+Summary: example/test programs from ncurses
+%global AppProgram ncurses-examples
+%global AltProgram ncursest-examples
+%global AppVersion MAJOR.MINOR
+%global AppRelease YYYYMMDD
+# $Id: ncurses-examples.spec,v 1.16 2019/11/23 21:11:34 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppRelease}
License: MIT
Group: Applications/Development
-URL: ftp://invisible-island.net/%{AppProgram}
+URL: ftp://ftp.invisible-island.net/%{AppProgram}
Source0: %{AppProgram}-%{AppRelease}.tgz
Packager: Thomas Dickey <dickey@invisible-island.net>
@@ -16,40 +17,102 @@ Packager: Thomas Dickey <dickey@invisible-island.net>
These are the example/test programs from the ncurses MAJOR.MINOR distribution,
for patch-date YYYYMMDD.
-This package installs in "bin/ncurses-examples" to avoid conflict with other
+This package installs in "bin/%{AppProgram}" to avoid conflict with other
packages.
+
+%package -n %{AltProgram}
+Summary: examples/test programs from ncurses with POSIX thread support
+
+%description -n %{AltProgram}
+These are the example/test programs from the ncurses MAJOR.MINOR distribution,
+for patch-date YYYYMMDD, using the "ncurseswt" library to demonstrate the
+use of POSIX threads, e.g., in ditto, rain, and worm.
+
+This package installs in "bin/%{AltProgram}" to avoid conflict with other
+packages.
+
%prep
%setup -q -n %{AppProgram}-%{AppRelease}
+%define debug_package %{nil}
+
%build
+%global _configure ../configure
+%define my_srcdir ..
+
+mkdir BUILD-%{AppProgram}
+pushd BUILD-%{AppProgram}
INSTALL_PROGRAM='${INSTALL}' \
- ./configure \
- --target %{_target_platform} \
- --prefix=%{_prefix} \
- --bindir=%{_bindir}/%{AppProgram} \
- --with-ncursesw \
- --disable-rpath-hack
+NCURSES_CONFIG_SUFFIX=dev \
+CONFIGURE_TOP=%{my_srcdir} \
+%configure \
+ --target %{_target_platform} \
+ --prefix=%{_prefix} \
+ --bindir=%{_bindir}/%{AppProgram} \
+ --datadir=%{_datadir}/%{AppProgram} \
+ --with-screen=ncursesw6dev \
+ --disable-rpath-hack
make
+popd
+
+mkdir BUILD-%{AltProgram}
+pushd BUILD-%{AltProgram}
+INSTALL_PROGRAM='${INSTALL}' \
+NCURSES_CONFIG_SUFFIX=dev \
+CONFIGURE_TOP=%{my_srcdir} \
+%configure \
+ --target %{_target_platform} \
+ --prefix=%{_prefix} \
+ --bindir=%{_bindir}/%{AltProgram} \
+ --datadir=%{_datadir}/%{AltProgram} \
+ --with-screen=ncursestw6dev \
+ --disable-rpath-hack
+
+make
+popd
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+pushd BUILD-%{AppProgram}
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
-strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram}/*
+pushd BUILD-%{AltProgram}
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+if rm -rf $RPM_BUILD_ROOT; then
+ echo OK
+else
+ find $RPM_BUILD_ROOT -type f | grep -F -v /.nfs && exit 1
+fi
+exit 0
-%files
+%files -n %{AppProgram}
%defattr(-,root,root)
%{_bindir}/%{AppProgram}/*
+%{_datadir}/%{AppProgram}/*
+
+%files -n %{AltProgram}
+%defattr(-,root,root)
+%{_bindir}/%{AltProgram}/*
+%{_datadir}/%{AltProgram}/*
%changelog
# each patch should add its ChangeLog entries here
+* Sat Nov 16 2019 Thomas Dickey
+- modify clean-rule to work around Fedora NFS bugs.
+
+* Sat Nov 11 2017 Thomas Dickey
+- add example data-files
+- use rpm built-in "configure"
+- suppress debug-package
+
* Thu Mar 25 2010 Thomas Dickey
- initial version
diff --git a/test/padview.c b/test/padview.c
new file mode 100644
index 0000000..6917e0e
--- /dev/null
+++ b/test/padview.c
@@ -0,0 +1,529 @@
+/****************************************************************************
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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. *
+ ****************************************************************************/
+/*
+ * clone of view.c, using pads
+ *
+ * $Id: padview.c,v 1.16 2020/02/02 23:34:34 tom Exp $
+ */
+
+#include <test.priv.h>
+#include <widechars.h>
+#include <popup_msg.h>
+
+#include <sys/stat.h>
+#include <time.h>
+
+#if HAVE_NEWPAD
+
+static void finish(int sig) GCC_NORETURN;
+
+#define my_pair 1
+
+static int shift = 0;
+static bool try_color = FALSE;
+
+static char *fname;
+static int num_lines;
+
+#if USE_WIDEC_SUPPORT
+static bool n_option = FALSE;
+#endif
+
+static void usage(void) GCC_NORETURN;
+
+static void
+failed(const char *msg)
+{
+ endwin();
+ fprintf(stderr, "%s\n", msg);
+ ExitProgram(EXIT_FAILURE);
+}
+
+static void
+finish(int sig)
+{
+ endwin();
+ ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+
+static void
+show_all(const char *tag, WINDOW *my_pad, int my_row)
+{
+ int i;
+ int digits;
+ char temp[BUFSIZ];
+ time_t this_time;
+
+ for (digits = 1, i = num_lines; i > 0; i /= 10) {
+ ++digits;
+ }
+
+ wattrset(stdscr, COLOR_PAIR(my_pair));
+ clear();
+
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "view %.*s", (int) strlen(tag), tag);
+ i = (int) strlen(temp);
+ _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i)
+ " %.*s", (int) sizeof(temp) - i - 2, fname);
+ mvprintw(0, 0, "%.*s", COLS, temp);
+ this_time = time((time_t *) 0);
+ _nc_STRNCPY(temp, ctime(&this_time), (size_t) 30);
+ if ((i = (int) strlen(temp)) != 0) {
+ temp[--i] = 0;
+ mvprintw(0, COLS - i - 2, " %s", temp);
+ }
+
+ for (i = 1; i < LINES; i++) {
+ int actual = my_row + i;
+ if (actual > num_lines) {
+ break;
+ }
+ mvprintw(i, 0, "%*d:", digits, actual);
+ }
+ wnoutrefresh(stdscr);
+ pnoutrefresh(my_pad, my_row, shift, 1, digits + 1, LINES - 1, COLS - 1);
+ doupdate();
+}
+
+static WINDOW *
+read_file(const char *filename)
+{
+ FILE *fp;
+ int pass;
+ int k;
+ int height, width;
+ size_t j;
+ size_t len;
+ struct stat sb;
+ char *my_blob;
+ char **my_vec = 0;
+ WINDOW *my_pad;
+
+ if (stat(filename, &sb) != 0
+ || (sb.st_mode & S_IFMT) != S_IFREG) {
+ failed("input is not a file");
+ }
+
+ if (sb.st_size == 0) {
+ failed("input is empty");
+ }
+
+ if ((fp = fopen(filename, "r")) == 0) {
+ failed("cannot open input-file");
+ }
+
+ if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0) {
+ failed("cannot allocate memory for input-file");
+ }
+
+ len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+ my_blob[sb.st_size] = '\0';
+ fclose(fp);
+
+ for (pass = 0; pass < 2; ++pass) {
+ char *base = my_blob;
+ k = 0;
+ for (j = 0; j < len; ++j) {
+ if (my_blob[j] == '\n') {
+ if (pass) {
+ my_vec[k] = base;
+ my_blob[j] = '\0';
+ }
+ base = my_blob + j + 1;
+ ++k;
+ }
+ }
+ num_lines = k;
+ if (base != (my_blob + j))
+ ++num_lines;
+ if (!pass &&
+ ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+ failed("cannot allocate line-vector #1");
+ }
+ }
+
+#if USE_WIDEC_SUPPORT
+ if (!memcmp("\357\273\277", my_blob, 3)) {
+ char *s = my_blob + 3;
+ char *d = my_blob;
+ Trace(("trim BOM"));
+ do {
+ } while ((*d++ = *s++) != '\0');
+ }
+#endif
+
+ height = num_lines;
+ width = (int) strlen(my_vec[0]);
+ for (k = 1; my_vec[k]; ++k) {
+ int check = (int) (my_vec[k] - my_vec[k - 1]);
+ if (width < check)
+ width = check;
+ }
+ width = (width + 1) * 5;
+ my_pad = newpad(height, width);
+ if (my_pad == 0)
+ failed("cannot allocate pad workspace");
+ if (try_color) {
+ wattrset(my_pad, COLOR_PAIR(my_pair));
+ wbkgd(my_pad, (chtype) (' ' | COLOR_PAIR(my_pair)));
+ }
+
+ /*
+ * Use the curses library for rendering, including tab-conversion.
+ */
+ Trace(("slurp the file"));
+ for (k = 0; my_vec[k]; ++k) {
+ char *s;
+#if USE_WIDEC_SUPPORT
+ char *last = my_vec[k] + (int) strlen(my_vec[k]);
+ wchar_t wch[2];
+ size_t rc;
+#ifndef state_unused
+ mbstate_t state;
+#endif
+#endif /* USE_WIDEC_SUPPORT */
+
+ wmove(my_pad, k, 0);
+#if USE_WIDEC_SUPPORT
+ wch[1] = 0;
+ reset_mbytes(state);
+#endif
+ for (s = my_vec[k]; *s != '\0'; ++s) {
+#if USE_WIDEC_SUPPORT
+ if (!n_option) {
+ rc = (size_t) check_mbytes(wch[0], s, (size_t) (last - s), state);
+ if ((long) rc == -1 || (long) rc == -2) {
+ break;
+ }
+ s += rc - 1;
+ waddwstr(my_pad, wch);
+ } else
+#endif
+ waddch(my_pad, *s & 0xff);
+ }
+ }
+
+ free(my_vec);
+ free(my_blob);
+
+ return my_pad;
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: view [options] file"
+ ,""
+ ,"Options:"
+ ," -c use color if terminal supports it"
+ ," -i ignore INT, QUIT, TERM signals"
+#if USE_WIDEC_SUPPORT
+ ," -n use waddch (bytes) rather then wadd_wch (wide-chars)"
+#endif
+ ," -s start in single-step mode, waiting for input"
+#ifdef TRACE
+ ," -t trace screen updates"
+ ," -T NUM specify trace mask"
+#endif
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+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",
+ " <,> - scroll the viewport left/right by 8 columns",
+ "",
+ " h,<Home> - scroll the viewport to top of file",
+ " ^F,<PageDn> - scroll to the next page",
+ " ^B,<PageUp> - scroll to the previous page",
+ " 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 i;
+ int my_delay = 0;
+ WINDOW *my_pad;
+ int my_row = 0;
+ int value = 0;
+ bool done = FALSE;
+ bool got_number = FALSE;
+ bool ignore_sigs = FALSE;
+ bool single_step = FALSE;
+ const char *my_label = "Input";
+
+ setlocale(LC_ALL, "");
+
+ while ((i = getopt(argc, argv, "cinstT:")) != -1) {
+ switch (i) {
+ case 'c':
+ try_color = TRUE;
+ break;
+ case 'i':
+ ignore_sigs = TRUE;
+ break;
+#if USE_WIDEC_SUPPORT
+ case 'n':
+ n_option = TRUE;
+ break;
+#endif
+ case 's':
+ single_step = TRUE;
+ break;
+#ifdef TRACE
+ case 'T':
+ {
+ char *next = 0;
+ int tvalue = (int) strtol(optarg, &next, 0);
+ if (tvalue < 0 || (next != 0 && *next != 0))
+ usage();
+ curses_trace((unsigned) tvalue);
+ }
+ break;
+ case 't':
+ curses_trace(TRACE_CALLS);
+ break;
+#endif
+ default:
+ usage();
+ }
+ }
+ if (optind + 1 != argc)
+ usage();
+
+ InitAndCatch(initscr(), ignore_sigs ? SIG_IGN : finish);
+ keypad(stdscr, TRUE); /* enable keyboard mapping */
+ (void) nonl(); /* tell curses not to do NL->CR/NL on output */
+ (void) cbreak(); /* take input chars one at a time, no wait for \n */
+ (void) noecho(); /* don't echo input */
+ if (!single_step)
+ nodelay(stdscr, TRUE);
+ idlok(stdscr, TRUE); /* allow use of insert/delete line */
+
+ if (try_color) {
+ if (has_colors()) {
+ start_color();
+ init_pair(my_pair, COLOR_WHITE, COLOR_BLUE);
+ bkgd((chtype) (' ' | COLOR_PAIR(my_pair)));
+ } else {
+ try_color = FALSE;
+ }
+ }
+
+ /*
+ * Do this after starting color, otherwise the pad's background will be
+ * uncolored after the ncurses 6.1.20181208 fixes.
+ */
+ my_pad = read_file(fname = argv[optind]);
+
+ my_row = 0;
+ while (!done) {
+ int n, c;
+
+ if (!got_number)
+ show_all(my_label, my_pad, my_row);
+
+ for (;;) {
+ c = getch();
+ if ((c < 127) && isdigit(c)) {
+ if (!got_number) {
+ MvPrintw(0, 0, "Count: ");
+ clrtoeol();
+ }
+ addch(UChar(c));
+ value = 10 * value + (c - '0');
+ got_number = TRUE;
+ } else
+ break;
+ }
+ if (got_number && value) {
+ n = value;
+ } else {
+ n = 1;
+ }
+
+ if (c != ERR)
+ my_label = keyname(c);
+ switch (c) {
+ case KEY_DOWN:
+ case 'n':
+ for (i = 0; i < n; i++)
+ if (my_row < (num_lines - LINES + 1))
+ my_row++;
+ else
+ break;
+ break;
+
+ case KEY_UP:
+ case 'p':
+ for (i = 0; i < n; i++)
+ if (my_row > 0)
+ my_row--;
+ else
+ break;
+ break;
+
+ case 'h':
+ /* FALLTHRU */
+ case KEY_HOME:
+ my_row = 0;
+ break;
+
+ case '<':
+ if ((shift -= 8) < 0)
+ shift = 0;
+ break;
+ case '>':
+ shift += 8;
+ break;
+
+ case 'e':
+ /* FALLTHRU */
+ case KEY_END:
+ if (num_lines > LINES)
+ my_row = (num_lines - LINES + 1);
+ else
+ my_row = (num_lines - 2);
+ break;
+
+ case CTRL('F'):
+ /* FALLTHRU */
+ case KEY_NPAGE:
+ for (i = 0; i < n; i++) {
+ if (my_row < (num_lines - 5))
+ my_row += (LINES - 1);
+ else
+ my_row = (num_lines - 2);
+ }
+ break;
+
+ case CTRL('B'):
+ /* FALLTHRU */
+ case KEY_PPAGE:
+ for (i = 0; i < n; i++) {
+ if (my_row >= LINES)
+ my_row -= (LINES - 1);
+ else
+ my_row = 0;
+ }
+ break;
+
+ case 'r':
+ case KEY_RIGHT:
+ shift += n;
+ break;
+
+ case 'l':
+ case KEY_LEFT:
+ shift -= n;
+ if (shift < 0) {
+ shift = 0;
+ beep();
+ }
+ break;
+
+ case 'q':
+ case QUIT:
+ case ESCAPE:
+ done = TRUE;
+ break;
+
+#ifdef KEY_RESIZE
+ case KEY_RESIZE: /* ignore this; ncurses will repaint */
+ break;
+#endif
+ case 's':
+#if HAVE_HALFDELAY
+ if (got_number) {
+ halfdelay(my_delay = n);
+ } else {
+ nodelay(stdscr, FALSE);
+ my_delay = -1;
+ }
+#else
+ nodelay(stdscr, FALSE);
+ my_delay = -1;
+#endif
+ break;
+ case ' ':
+ nodelay(stdscr, TRUE);
+ my_delay = 0;
+ break;
+ case CTRL('L'):
+ redrawwin(stdscr);
+ break;
+ case ERR:
+ if (!my_delay)
+ napms(50);
+ break;
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
+ default:
+ beep();
+ break;
+ }
+ if (c >= KEY_MIN || (c > 0 && !isdigit(c))) {
+ got_number = FALSE;
+ value = 0;
+ }
+ }
+
+ finish(0); /* we're done */
+}
+#else
+int
+main(void)
+{
+ printf("This program requires the curses pad functions\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/pair_content.c b/test/pair_content.c
new file mode 100644
index 0000000..fc5926b
--- /dev/null
+++ b/test/pair_content.c
@@ -0,0 +1,317 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: pair_content.c,v 1.14 2020/02/02 23:34:34 tom Exp $
+ */
+
+#define NEED_TIME_H
+#include <test.priv.h>
+
+#if USE_EXTENDED_COLOR
+typedef int my_color_t;
+#else
+typedef NCURSES_COLOR_T my_color_t;
+#endif
+
+typedef struct {
+ my_color_t fg;
+ my_color_t bg;
+} MYPAIR;
+
+static int f_opt;
+static int i_opt;
+static int l_opt;
+static int n_opt;
+static int p_opt;
+static int r_opt;
+static int s_opt;
+
+#if USE_EXTENDED_COLOR
+static int x_opt;
+#endif
+
+static MYPAIR *expected;
+
+#if HAVE_GETTIMEOFDAY
+static struct timeval initial_time;
+static struct timeval finish_time;
+#endif
+
+static void
+failed(const char *msg)
+{
+ printw("%s", msg);
+ getch();
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+#if USE_EXTENDED_COLOR
+static int
+InitPair(int pair, int fg, int bg)
+{
+ int rc;
+ if (x_opt) {
+ rc = init_extended_pair(pair, fg, bg);
+ } else {
+ rc = init_pair((NCURSES_PAIRS_T) pair,
+ (NCURSES_COLOR_T) fg,
+ (NCURSES_COLOR_T) bg);
+ }
+ return rc;
+}
+
+static int
+PairContent(int pair, int *fgp, int *bgp)
+{
+ int rc;
+ if (x_opt) {
+ rc = extended_pair_content(pair, fgp, bgp);
+ } else {
+ short fg, bg;
+ if ((rc = pair_content((short) pair, &fg, &bg)) == OK) {
+ *fgp = fg;
+ *bgp = bg;
+ }
+ }
+ return rc;
+}
+#else
+#define InitPair(pair,fg,bg) init_pair((NCURSES_COLOR_T)pair,(NCURSES_COLOR_T)fg,(NCURSES_COLOR_T)bg)
+#define PairContent(pair,fgp,bgp) pair_content((NCURSES_PAIRS_T)pair,fgp,bgp)
+#endif
+
+static my_color_t
+random_color(void)
+{
+ return (my_color_t) (rand() % COLORS);
+}
+
+static void
+setup_test(void)
+{
+ initscr();
+ cbreak();
+ noecho();
+ scrollok(stdscr, TRUE);
+ if (has_colors()) {
+ start_color();
+
+ if (!f_opt)
+ f_opt = 1;
+ if (!l_opt)
+ l_opt = COLOR_PAIRS;
+ if (l_opt <= 1)
+ failed("color-pair limit must be greater than one");
+
+ if (!n_opt) {
+ int pair;
+ size_t need = (size_t) ((l_opt > COLOR_PAIRS)
+ ? l_opt
+ : COLOR_PAIRS) + 1;
+
+ expected = typeCalloc(MYPAIR, need);
+ if (s_opt) {
+ my_color_t fg;
+ my_color_t bg;
+ pair = f_opt;
+ for (fg = 0; fg < COLORS; ++fg) {
+ for (bg = 0; bg < COLORS; ++bg) {
+ if (pair < l_opt) {
+ InitPair(pair, fg, bg);
+ expected[pair].fg = (my_color_t) fg;
+ expected[pair].bg = (my_color_t) bg;
+ ++pair;
+ } else {
+ break;
+ }
+ }
+ }
+ } else {
+ for (pair = f_opt; pair < l_opt; ++pair) {
+ expected[pair].fg = random_color();
+ expected[pair].bg = random_color();
+ InitPair(pair, expected[pair].fg, expected[pair].bg);
+ }
+ }
+ }
+ } else {
+ failed("This demo requires a color terminal");
+ }
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&initial_time, 0);
+#endif
+}
+
+static void
+run_test(void)
+{
+ int pair;
+ bool success = TRUE;
+ for (pair = 1; pair < l_opt; ++pair) {
+ my_color_t fg;
+ my_color_t bg;
+ if (PairContent(pair, &fg, &bg) == OK) {
+ if (expected != 0) {
+ if (fg != expected[pair].fg)
+ success = FALSE;
+ if (bg != expected[pair].bg)
+ success = FALSE;
+ }
+ }
+ }
+ if (i_opt) {
+ addch(success ? '.' : '?');
+ refresh();
+ }
+}
+
+static void
+finish_test(void)
+{
+ getch();
+ endwin();
+}
+
+#if HAVE_GETTIMEOFDAY
+static double
+seconds(struct timeval *mark)
+{
+ double result = (double) mark->tv_sec;
+ result += ((double) mark->tv_usec / 1e6);
+ return result;
+}
+#endif
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: pair_content [options]"
+ ,""
+ ,"Options:"
+ ," -f PAIR first color pair to test (default: 1)"
+ ," -i interactive, showing test-progress"
+ ," -l PAIR last color pair to test (default: max_pairs-1)"
+ ," -n do not initialize color pairs"
+ ," -p print data for color pairs instead of testing"
+ ," -r COUNT repeat for given count"
+ ," -s initialize pairs sequentially rather than random"
+#if USE_EXTENDED_COLOR
+ ," -x use extended color pairs/values"
+#endif
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int i;
+
+ while ((i = getopt(argc, argv, "f:il:npr:sx")) != -1) {
+ switch (i) {
+ case 'f':
+ if ((f_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'i':
+ i_opt = 1;
+ break;
+ case 'l':
+ if ((l_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'n':
+ n_opt = 1;
+ break;
+ case 'p':
+ p_opt = 1;
+ break;
+ case 'r':
+ if ((r_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 's':
+ s_opt = 1;
+ break;
+#if USE_EXTENDED_COLOR
+ case 'x':
+ x_opt = 1;
+ break;
+#endif
+ default:
+ usage();
+ }
+ }
+ if (optind < argc)
+ usage();
+ if (r_opt <= 0)
+ r_opt = 1;
+
+ setup_test();
+ if (p_opt) {
+ endwin();
+ for (i = f_opt; i < l_opt; ++i) {
+ my_color_t fg, bg;
+ if (PairContent(i, &fg, &bg) == OK) {
+ printf("%d: %d %d\n", i, fg, bg);
+ } else {
+ printf("%d: ? ?\n", i);
+ }
+ }
+ } else {
+ int repeat;
+
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ run_test();
+ if (i_opt) {
+ addch('.');
+ refresh();
+ }
+ }
+
+ if (i_opt) {
+ addch('\n');
+ }
+ printw("DONE: ");
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&finish_time, 0);
+ printw("%.03f seconds",
+ seconds(&finish_time)
+ - seconds(&initial_time));
+#endif
+ finish_test();
+ }
+
+ ExitProgram(EXIT_SUCCESS);
+}
diff --git a/test/parse_rgb.h b/test/parse_rgb.h
new file mode 100644
index 0000000..df315b5
--- /dev/null
+++ b/test/parse_rgb.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+/*
+ * $Id: parse_rgb.h,v 1.5 2020/02/02 23:34:34 tom Exp $
+ *
+ * Sample implementation of ncurses RGB extension from user_caps(5).
+ */
+#ifndef PARSE_RBG_H_incl
+#define PARSE_RBG_H_incl 1
+
+#include <test.priv.h>
+
+#if HAVE_TIGETSTR && USE_WIDEC_SUPPORT
+static int
+parse_rgb(int *r_max, int *g_max, int *b_max)
+{
+ int colors = tigetnum("colors");
+ int result = ERR;
+
+ *r_max = *g_max = *b_max = 0;
+
+ if (colors > 0) {
+ int max_bits;
+ int bits;
+ int pwr2;
+ int r = 0, g = 0, b = 0;
+ char *data;
+ char ch;
+
+ for (max_bits = 0, pwr2 = 1;
+ pwr2 < colors;
+ ++max_bits, pwr2 <<= 1) {
+ ;
+ }
+
+ if (tigetflag("RGB") > 0) {
+ result = OK;
+ r = g = b = (max_bits + 2) / 3;
+ } else if ((bits = tigetnum("RGB")) > 0) {
+ result = OK;
+ r = g = b = bits;
+ } else if ((data = tigetstr("RGB")) != ABSENT_STRING
+ && data != CANCELLED_STRING
+ && sscanf(data, "%d/%d/%d%c", &r, &g, &b, &ch) == 3) {
+ result = OK;
+ }
+
+ if ((r + g + b) < max_bits) {
+ result = ERR;
+ } else if (result == 0) {
+ if (r > max_bits) {
+ r = max_bits;
+ g = b = 0;
+ }
+ *r_max = r;
+ if (g > (max_bits -= r)) {
+ g = max_bits;
+ b = 0;
+ }
+ *g_max = g;
+ if (b > (max_bits -= g)) {
+ b = max_bits;
+ }
+ *b_max = b;
+ }
+ }
+ return result;
+}
+#else
+#define parse_rgb(r,g,b) (ERR)
+#endif
+
+#endif /* PARSE_RBG_H_incl */
diff --git a/test/picsmap.c b/test/picsmap.c
new file mode 100644
index 0000000..432fbf7
--- /dev/null
+++ b/test/picsmap.c
@@ -0,0 +1,1763 @@
+/****************************************************************************
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2017,2018 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: picsmap.c,v 1.132 2020/02/02 23:34:34 tom Exp $
+ *
+ * Author: Thomas E. Dickey
+ *
+ * A little more interesting than "dots", read a simple image into memory and
+ * measure the time taken to paint it normally vs randomly.
+ *
+ * TODO improve use of rgb-names using tsearch.
+ *
+ * TODO add option to dump picture in non-optimized mode, e.g., like tput.
+ * TODO write cells/second to stderr (or log)
+ * TODO write picture left-to-right/top-to-bottom
+ * TODO write picture randomly
+ * TODO add one-shot option vs repeat-count before exiting
+ * TODO add option "-xc" for init_color vs init_extended_color
+ * TODO add option "-xa" for init_pair vs alloc_pair
+ * TODO use pad to allow pictures larger than screen
+ * TODO add option to just use convert (which can scale) vs builtin xbm/xpm.
+ * TODO add scr_dump and scr_restore calls
+ * TODO add option for assume_default_colors
+ */
+#include <test.priv.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#define my_intptr_t intptr_t
+#else
+#define my_intptr_t long
+#endif
+
+#if HAVE_TSEARCH
+#include <search.h>
+#endif
+
+#undef CUR /* use only the curses interface */
+
+#define L_BLOCK '['
+#define R_BLOCK ']'
+
+#define L_CURLY '{'
+#define R_CURLY '}'
+
+#define MaxSCALE 1000 /* input curses ranges 0..1000 */
+#define MaxRGB 255 /* output color ranges 0..255 */
+#define okCOLOR(n) ((n) >= 0 && (n) < COLORS)
+#define okSCALE(n) ((n) >= 0 && (n) <= MaxSCALE)
+#define Scaled256(n) (NCURSES_COLOR_T) (int)(((double)(n) * MaxSCALE) / 255)
+#define ScaledColor(n) (NCURSES_COLOR_T) (int)(((double)(n) * MaxSCALE) / scale)
+
+#ifndef RGB_PATH
+#define RGB_PATH "/etc/X11/rgb.txt"
+#endif
+
+#include <picsmap.h>
+
+typedef struct {
+ size_t file;
+ size_t name;
+ size_t list;
+ size_t data;
+ size_t head;
+ size_t pair;
+ size_t cell;
+} HOW_MUCH;
+
+#undef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+
+/*
+ * tfind will return null on failure, so we map subscripts starting at one.
+ */
+#define P2I(n) (((int)(my_intptr_t)(n)) - 1)
+#define I2P(n) (void *)(my_intptr_t)((n) + 1)
+
+#define pause_curses() if (in_curses) stop_curses()
+
+#define debugmsg if (debugging) logmsg
+#define debugmsg2 if (debugging) logmsg2
+
+static void cleanup(int) GCC_NORETURN;
+static void giveup(const char *fmt, ...) GCC_PRINTFLIKE(1, 2);
+static void logmsg(const char *fmt, ...) GCC_PRINTFLIKE(1, 2);
+static void logmsg2(const char *fmt, ...) GCC_PRINTFLIKE(1, 2);
+static void warning(const char *fmt, ...) GCC_PRINTFLIKE(1, 2);
+static int gather_c_values(int);
+
+static FILE *logfp = 0;
+static double aspect_ratio = 0.6;
+static bool in_curses = FALSE;
+static bool debugging = FALSE;
+static bool quiet = FALSE;
+static int slow_time = -1;
+static RGB_NAME *rgb_table;
+static RGB_DATA *all_colors;
+static HOW_MUCH how_much;
+
+static int reading_last;
+static int reading_size;
+static FG_NODE *reading_ncols;
+
+#if HAVE_TSEARCH
+static void *reading_ntree;
+#endif
+
+#if HAVE_ALLOC_PAIR && USE_EXTENDED_COLOR
+#define USE_EXTENDED_COLORS 1
+static bool use_extended_pairs = FALSE;
+static bool use_extended_colors = FALSE;
+#else
+#define USE_EXTENDED_COLORS 0
+#endif
+
+static void
+logmsg(const char *fmt, ...)
+{
+ if (logfp != 0) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(logfp, fmt, ap);
+ va_end(ap);
+ fputc('\n', logfp);
+ fflush(logfp);
+ }
+}
+
+static void
+logmsg2(const char *fmt, ...)
+{
+ if (logfp != 0) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(logfp, fmt, ap);
+ va_end(ap);
+ fflush(logfp);
+ }
+}
+
+static void
+close_log(void)
+{
+ if (logfp != 0) {
+ logmsg("Allocations:");
+ logmsg("%8ld file", (long) how_much.file);
+ logmsg("%8ld name", (long) how_much.name);
+ logmsg("%8ld list", (long) how_much.list);
+ logmsg("%8ld data", (long) how_much.data);
+ logmsg("%8ld head", (long) how_much.head);
+ logmsg("%8ld pair", (long) how_much.pair);
+ logmsg("%8ld cell", (long) how_much.cell);
+ logmsg("%8ld window", LINES * COLS * (long) sizeof(NCURSES_CH_T));
+ fclose(logfp);
+ logfp = 0;
+ }
+}
+
+static void
+cleanup(int code)
+{
+ pause_curses();
+ close_log();
+ ExitProgram(code);
+ /* NOTREACHED */
+}
+
+static void
+failed(const char *msg)
+{
+ int save = errno;
+ perror(msg);
+ logmsg("failed with %s", strerror(save));
+ cleanup(EXIT_FAILURE);
+}
+
+static void
+warning(const char *fmt, ...)
+{
+ if (logfp != 0) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(logfp, fmt, ap);
+ va_end(ap);
+ fputc('\n', logfp);
+ fflush(logfp);
+ } else {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fputc('\n', stderr);
+ cleanup(EXIT_FAILURE);
+ }
+}
+
+static void
+free_data(char **data)
+{
+ if (data != 0) {
+ free(data[0]);
+ free(data);
+ }
+}
+
+static PICS_HEAD *
+free_pics_head(PICS_HEAD * pics)
+{
+ if (pics != 0) {
+ free(pics->fgcol);
+ free(pics->cells);
+ free(pics->name);
+ free(pics);
+ pics = 0;
+ }
+ return pics;
+}
+
+static void
+begin_c_values(int size)
+{
+ reading_last = 0;
+ reading_size = size;
+ reading_ncols = typeCalloc(FG_NODE, size + 1);
+ how_much.pair += (sizeof(FG_NODE) * (size_t) size);
+ /* black is always the first slot, to work around P2I/I2P logic */
+ gather_c_values(0);
+}
+
+#if HAVE_TSEARCH
+static int
+compare_c_values(const void *p, const void *q)
+{
+ const int a = P2I(p);
+ const int b = P2I(q);
+ return (reading_ncols[a].fgcol - reading_ncols[b].fgcol);
+}
+
+#ifdef DEBUG_TSEARCH
+static void
+check_c_values(int ln)
+{
+ static int oops = 5;
+ FG_NODE **ft;
+ int n;
+ for (n = 0; n < reading_last; ++n) {
+ ft = tfind(I2P(n), &reading_ntree, compare_c_values);
+ if (ft != 0) {
+ int q = P2I(*ft);
+ if (reading_ncols[q].fgcol != reading_ncols[n].fgcol) {
+ logmsg("@%d, %d:%d (%d) %d %d fgcol %06X %06X", ln, n,
+ reading_last - 1,
+ reading_size,
+ q, n,
+ reading_ncols[n].fgcol,
+ reading_ncols[q].fgcol);
+ }
+ } else {
+ logmsg("@%d, %d:%d (%d) ? %d null %06X", ln, n,
+ reading_last - 1,
+ reading_size,
+ n,
+ reading_ncols[n].fgcol);
+ if (oops-- <= 0)
+ return;
+ }
+ }
+}
+#else
+#define check_c_values(n) /* nothing */
+#endif
+#endif
+
+static int
+gather_c_values(int fg)
+{
+ int found = -1;
+#if HAVE_TSEARCH
+ FG_NODE **ft;
+ int next = reading_last;
+
+ reading_ncols[next].fgcol = fg;
+ reading_ncols[next].count = 0;
+
+ check_c_values(__LINE__);
+ if ((ft = tfind(I2P(next), &reading_ntree, compare_c_values)) != 0) {
+ found = P2I(*ft);
+ } else {
+ if (reading_last + 2 >= reading_size) {
+ int more = ((MAX(reading_last, reading_size) + 2) * 3) / 2;
+ int last = reading_last + 1;
+ FG_NODE *p = typeRealloc(FG_NODE, more, reading_ncols);
+ if (p == 0)
+ goto done;
+
+ reading_size = more;
+ reading_ncols = p;
+ memset(reading_ncols + last, 0,
+ sizeof(FG_NODE) * (size_t) (more - last));
+ check_c_values(__LINE__);
+ }
+ ++reading_last;
+ how_much.pair += sizeof(FG_NODE);
+ if ((ft = tsearch(I2P(next), &reading_ntree, compare_c_values)) != 0) {
+ found = P2I(*ft);
+ if (found != next)
+ logmsg("OOPS expected slot %d, got %d", next, found);
+ debugmsg("allocated color #%d as #%06X", next, fg);
+ check_c_values(__LINE__);
+ }
+ }
+#else
+ int n;
+
+ for (n = 0; n < reading_last; ++n) {
+ if (reading_ncols[n].fgcol == fg) {
+ found = n;
+ break;
+ }
+ }
+ if (found < 0) {
+ if (reading_last + 2 >= reading_size) {
+ int more = ((reading_last + 2) * 3) / 2;
+ FG_NODE *p = typeRealloc(FG_NODE, more, reading_ncols);
+ if (p == 0)
+ goto done;
+
+ how_much.pair -= (sizeof(FG_NODE) * (size_t) reading_size);
+ how_much.pair += (sizeof(FG_NODE) * (size_t) more);
+ reading_size = more;
+ reading_ncols = p;
+ memset(reading_ncols + reading_last, 0,
+ sizeof(FG_NODE) * (size_t) (more - reading_last));
+ }
+ reading_ncols[reading_last].fgcol = fg;
+ found = reading_last++;
+ }
+#endif
+ done:
+ return found;
+}
+
+static void
+finish_c_values(PICS_HEAD * head)
+{
+ head->colors = reading_last;
+ head->fgcol = reading_ncols;
+
+ reading_last = 0;
+ reading_size = 0;
+ reading_ncols = 0;
+}
+
+static void
+dispose_c_values(void)
+{
+#if HAVE_TSEARCH
+ if (reading_ntree != 0) {
+ int n;
+ for (n = 0; n < reading_last; ++n) {
+ tdelete(I2P(n), &reading_ntree, compare_c_values);
+ }
+ reading_ntree = 0;
+ }
+#endif
+ if (reading_ncols != 0) {
+ free(reading_ncols);
+ reading_ncols = 0;
+ }
+ reading_last = 0;
+ reading_size = 0;
+}
+
+static int
+is_file(const char *filename, struct stat *sb)
+{
+ int result = 0;
+ if (stat(filename, sb) == 0
+ && (sb->st_mode & S_IFMT) == S_IFREG
+ && sb->st_size != 0) {
+ result = 1;
+ }
+ debugmsg("is_file(%s) %d", filename, result);
+ return result;
+}
+
+/*
+ * Simplify reading xbm/xpm files by first making an array of lines. Blank
+ * lines are filtered out.
+ */
+static char **
+read_file(const char *filename)
+{
+ char **result = 0;
+ struct stat sb;
+
+ if (!quiet) {
+ pause_curses();
+ printf("** %s\n", filename);
+ }
+
+ if (is_file(filename, &sb)) {
+ size_t size = (size_t) sb.st_size;
+ char *blob = typeCalloc(char, size + 1);
+ bool binary = FALSE;
+ unsigned k = 0;
+
+ result = typeCalloc(char *, size + 1);
+ how_much.file += ((size + 1) * 2);
+
+ if (blob != 0 && result != 0) {
+ FILE *fp = fopen(filename, "r");
+ if (fp != 0) {
+ logmsg("opened %s", filename);
+
+ if (fread(blob, sizeof(char), size, fp) == size) {
+ bool had_line = TRUE;
+ unsigned j;
+
+ for (j = 0; (size_t) j < size; ++j) {
+ if (blob[j] == '\0' ||
+ (UChar(blob[j]) < 32 &&
+ !isspace(UChar(blob[j]))) ||
+ (UChar(blob[j]) >= 128 && UChar(blob[j]) < 160)) {
+ binary = TRUE;
+ }
+ if (blob[j] == '\n') {
+ blob[j] = '\0';
+ if (k && !binary) {
+ debugmsg2("[%5d] %s\n", k, result[k - 1]);
+ }
+ had_line = TRUE;
+ } else if (had_line) {
+ had_line = FALSE;
+ result[k++] = blob + j;
+ }
+ }
+ result[k] = 0;
+ if (k && !binary) {
+ debugmsg2("[%5d] %s\n", k, result[k - 1]);
+ }
+ }
+ fclose(fp);
+ } else {
+ logmsg("cannot open %s", filename);
+ }
+ }
+ if (k == 0) {
+ debugmsg("...file is empty");
+ free(blob);
+ free(result);
+ result = 0;
+ } else if (binary) {
+ debugmsg("...file is non-text");
+ }
+ }
+ return result;
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: picsmap [options] [imagefile [...]]"
+ ,"Read/display one or more xbm/xpm files (possibly use \"convert\")"
+ ,""
+ ,"Options:"
+ ," -a ratio aspect-ratio correction for ImageMagick"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -L add debugging information to logfile"
+ ," -l logfile write informational messages to logfile"
+ ," -p palette color-palette file (default \"$TERM.dat\")"
+ ," -q less verbose"
+ ," -r rgb-path xpm uses X rgb color-names (default \"" RGB_PATH "\")"
+ ," -s SECS pause for SECS seconds after display vs getch"
+#if USE_EXTENDED_COLORS
+ ," -x [pc] use extension (p=extended-pairs, c=extended-colors)"
+ ," Either/both extension may be given"
+#endif
+ };
+ size_t n;
+
+ pause_curses();
+
+ fflush(stdout);
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ cleanup(EXIT_FAILURE);
+}
+
+static void
+giveup(const char *fmt, ...)
+{
+ va_list ap;
+
+ pause_curses();
+ fflush(stdout);
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ fputc('\n', stderr);
+ va_end(ap);
+
+ if (logfp) {
+ va_start(ap, fmt);
+ vfprintf(logfp, fmt, ap);
+ fputc('\n', logfp);
+ va_end(ap);
+ fflush(logfp);
+ }
+
+ usage();
+}
+
+/*
+ * Palette files are named for $TERM values. However, there are fewer palette
+ * files than $TERM's. Although there are known problems (some cannot even get
+ * black and white correct), for the purpose of comparison, pretending that
+ * those map into "xterm" is useful.
+ */
+static char **
+read_palette(const char *filename)
+{
+ static const char *data_dir = DATA_DIR;
+ char **result = 0;
+ size_t last = strlen(filename);
+ size_t need = (strlen(data_dir) + 20 + last);
+ char *full_name = malloc(need);
+ char *s;
+ struct stat sb;
+
+ if (full_name != 0) {
+ int tries;
+ for (tries = 0; tries < 8; ++tries) {
+
+ *(s = full_name) = '\0';
+ if (tries & 1) {
+ if (strchr(filename, '/') == 0) {
+ _nc_SPRINTF(full_name, _nc_SLIMIT(need) "%s/", data_dir);
+ } else {
+ continue;
+ }
+ }
+ s += strlen(s);
+ if (((size_t) (s - full_name) + last + 1) >= need)
+ continue;
+
+ _nc_STRCAT(full_name, filename, need);
+ if (tries & 4) {
+ char *t = s;
+ char *tc;
+ int num;
+ char chr;
+ int found = 0;
+ while (*t != '\0') {
+ if (*t == '-') {
+ if (sscanf(t, "-%d%c", &num, &chr) == 2 &&
+ chr == 'c' &&
+ (tc = strchr(t, chr)) != 0 &&
+ !(strncmp) (tc, "color", 5)) {
+ found = 1;
+ }
+ break;
+ }
+ ++t;
+ }
+ if (found && (t != s)
+ && (strncmp) (s, "xterm", (size_t) (t - s))) {
+ _nc_SPRINTF(s, _nc_SLIMIT(need - (size_t) (s - full_name))
+ "xterm%s", filename + (t - s));
+ } else {
+ continue;
+ }
+ }
+ s += strlen(s);
+
+ if (tries & 2) {
+ int len = (int) strlen(filename);
+ if (len <= 4 || strcmp(filename + len - 4, ".dat")) {
+ _nc_STRCAT(full_name, ".dat", need);
+ } else {
+ continue;
+ }
+ }
+ if (is_file(full_name, &sb))
+ goto ok;
+ }
+ goto failed;
+ ok:
+ result = read_file(full_name);
+ failed:
+ free(full_name);
+ }
+ return result;
+}
+
+static void
+init_palette(const char *palette_file)
+{
+ if (palette_file != 0) {
+ char **data = read_palette(palette_file);
+
+ all_colors = typeMalloc(RGB_DATA, (unsigned) COLORS);
+ how_much.data += (sizeof(RGB_DATA) * (unsigned) COLORS);
+
+#if HAVE_COLOR_CONTENT
+ {
+ int cp;
+ for (cp = 0; cp < COLORS; ++cp) {
+ color_content((short) cp,
+ &all_colors[cp].red,
+ &all_colors[cp].green,
+ &all_colors[cp].blue);
+ }
+ }
+#else
+ memset(all_colors, 0, sizeof(RGB_DATA) * (size_t) COLORS);
+#endif
+ if (data != 0) {
+ int n;
+ int red, green, blue;
+ int scale = MaxSCALE;
+ int c;
+ for (n = 0; data[n] != 0; ++n) {
+ if (sscanf(data[n], "scale:%d", &c) == 1) {
+ scale = c;
+ } else if (sscanf(data[n], "%d:%d %d %d",
+ &c,
+ &red,
+ &green,
+ &blue) == 4
+ && okCOLOR(c)
+ && okSCALE(red)
+ && okSCALE(green)
+ && okSCALE(blue)) {
+ /* *INDENT-EQLS* */
+ all_colors[c].red = ScaledColor(red);
+ all_colors[c].green = ScaledColor(green);
+ all_colors[c].blue = ScaledColor(blue);
+ }
+ }
+ }
+ free_data(data);
+ /* *INDENT-EQLS* */
+ } else if (COLORS > 1) {
+ int power2 = 1;
+ int shift = 0;
+
+ while (power2 < COLORS) {
+ ++shift;
+ power2 <<= 1;
+ }
+
+ if ((power2 != COLORS) || ((shift % 3) != 0)) {
+ if (all_colors == 0) {
+ init_palette(getenv("TERM"));
+ if (all_colors == 0) {
+ giveup("With %d colors, you need a palette-file", COLORS);
+ }
+ }
+ }
+ }
+}
+
+/*
+ * Map the 24-bit RGB value to a color index if using a palette, otherwise to a
+ * direct color value.
+ */
+static int
+map_color(int value)
+{
+ int result = value;
+
+ if (result < 0) {
+ result = -1;
+ } else {
+ /* *INDENT-EQLS* */
+ int red = (value & 0xff0000) >> 16;
+ int green = (value & 0x00ff00) >> 8;
+ int blue = (value & 0x0000ff) >> 0;
+
+ if (all_colors != 0) {
+#define Diff2(n,m) ((m) - all_colors[n].m) * ((m) - all_colors[n].m)
+#define Diff2S(n) Diff2(n,red) + Diff2(n,green) + Diff2(n,blue)
+ int d2 = Diff2S(0);
+ int n;
+
+ /* *INDENT-EQLS* */
+ red = Scaled256(red);
+ green = Scaled256(green);
+ blue = Scaled256(blue);
+
+ for (result = 0, n = 1; n < COLORS; ++n) {
+ int d = Diff2(n, red) + Diff2(n, green) + Diff2(n, blue);
+ if (d < d2) {
+ d2 = d;
+ result = n;
+ }
+ }
+ } else { /* direct color */
+ int power2 = 1;
+ int shifts = 8;
+
+ while (power2 < COLORS) {
+ power2 <<= 3;
+ shifts--;
+ }
+
+ if (shifts > 0) {
+ /* TODO: round up */
+ red >>= shifts;
+ green >>= shifts;
+ blue >>= shifts;
+ result = ((red << (2 * (8 - shifts)))
+ + (green << (8 - shifts))
+ + blue);
+ }
+ }
+ }
+ return result;
+}
+
+static int
+bytes_of(int value)
+{
+ if (value & 7) {
+ value |= 7;
+ value++;
+ }
+ return value;
+}
+
+static int match_c(const char *, const char *, ...) GCC_SCANFLIKE(2,3);
+
+static char *
+skip_s(char *s)
+{
+ while (isspace(UChar(*s)))
+ s++;
+ return s;
+}
+
+static const char *
+skip_cs(const char *s)
+{
+ while (isspace(UChar(*s)))
+ s++;
+ return s;
+}
+
+static char *
+skip_word(char *s)
+{
+ s = skip_s(s);
+ while (isgraph(UChar(*s)))
+ s++;
+ return s;
+}
+
+static int
+match_c(const char *source, const char *pattern, ...)
+{
+ int limit = (int) strlen(source);
+ const char *last_s = source + limit;
+ va_list ap;
+ int ch;
+ int *ip;
+ char *cp;
+ long lv;
+
+ va_start(ap, pattern);
+
+ limit = -1;
+ while (*pattern != '\0') {
+ ch = UChar(*pattern++);
+ /* blank in the pattern matches zero-or-more blanks in source */
+ if (isspace(ch)) {
+ source = skip_cs(source);
+ continue;
+ }
+ /* %c, %d, %s are like sscanf except for special treatment of blanks */
+ if (ch == '%' && *pattern != '\0' && strchr("cdnsx", *pattern)) {
+ bool found = FALSE;
+ ch = *pattern++;
+ switch (ch) {
+ case 'c':
+ cp = va_arg(ap, char *);
+ do {
+ *cp++ = *source++;
+ } while (--limit > 0);
+ break;
+ case 'd':
+ case 'x':
+ limit = -1;
+ ip = va_arg(ap, int *);
+ lv = strtol(source, &cp, ch == 'd' ? 10 : 16);
+ if (cp != 0 && cp != source) {
+ *ip = (int) lv;
+ source = cp;
+ } else {
+ goto finish;
+ }
+ break;
+ case 'n':
+ /* not really sscanf... */
+ limit = *va_arg(ap, int *);
+ break;
+ case 's':
+ limit = -1;
+ cp = va_arg(ap, char *);
+ while (*source != '\0') {
+ ch = UChar(*source);
+ if (isspace(ch)) {
+ break;
+ } else if (found && (ch == *skip_cs(pattern))) {
+ break;
+ } else {
+ *cp++ = *source++;
+ found = TRUE;
+ }
+ }
+ *cp = '\0';
+ break;
+ }
+ continue;
+ }
+ /* other characters are matched literally */
+ if (*source++ != ch) {
+ break;
+ }
+ }
+ finish:
+
+ va_end(ap);
+ if (source > last_s)
+ source = last_s;
+ return (*source || *pattern) ? 0 : 1;
+}
+
+static int
+match_colors(const char *source, int cpp, char *arg1, char *arg2, char *arg3)
+{
+ int result = 0;
+
+ /* most files use a quasi-fixed format */
+ if (match_c(source, " \"%n%c %s %s \" , ", &cpp, arg1, arg2, arg3)) {
+ arg1[cpp] = '\0';
+ result = 1;
+ } else {
+ const char *s = skip_cs(source);
+ size_t have = strlen(source);
+
+ if (*s++ == '"' && have > ((size_t) cpp + 2)) {
+ memcpy(arg1, s, (size_t) cpp);
+ s += cpp;
+ while (*s++ == '\t') {
+ char *t;
+ for (t = arg2; (*s != '\0') && strchr("\t\"", *s) == 0;) {
+ if (*s == ' ') {
+ s = skip_cs(s);
+ break;
+ }
+ *t++ = *s++;
+ *t = '\0';
+ }
+ for (t = arg3; (*s != '\0') && strchr("\t\"", *s) == 0;) {
+ *t++ = *s++;
+ *t = '\0';
+ }
+ if (!strcmp(arg2, "c")) {
+ result = 1;
+ break;
+ }
+ }
+ }
+ }
+ return result;
+}
+
+static RGB_NAME *
+parse_rgb(char **data)
+{
+ char buf[BUFSIZ];
+ int n;
+ unsigned long r, g, b;
+ char *s, *t;
+ size_t item = 0;
+ size_t need;
+ RGB_NAME *result = 0;
+
+ for (need = 0; data[need] != 0; ++need) ;
+
+ result = typeCalloc(RGB_NAME, need + 2);
+ how_much.name += (sizeof(RGB_NAME) * (need + 2));
+
+ for (n = 0; data[n] != 0; ++n) {
+ if (strlen(t = data[n]) >= sizeof(buf) - 1)
+ continue;
+ if (*(s = skip_s(t)) == '!')
+ continue;
+
+ r = strtoul(s, &t, 10);
+ s = skip_s(t);
+ g = strtoul(s, &t, 10);
+ s = skip_s(t);
+ b = strtoul(s, &t, 10);
+ s = skip_s(t);
+
+ result[item].name = s;
+ t = s + strlen(s);
+ while (t-- != s && isspace(UChar(*t))) {
+ *t = '\0';
+ }
+ result[item].value = (int) ((r & 0xff) << 16 |
+ (g & 0xff) << 8 |
+ (b & 0xff));
+ ++item;
+ }
+
+ result[item].name = "none";
+ result[item].value = -1;
+
+ return result;
+}
+
+static RGB_NAME *
+lookup_rgb(const char *name)
+{
+ RGB_NAME *result = 0;
+ if (rgb_table != 0) {
+ int n;
+ for (n = 0; rgb_table[n].name != 0; ++n) {
+ if (!strcasecmp(name, rgb_table[n].name)) {
+ result = &rgb_table[n];
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+static PICS_HEAD *
+parse_xbm(char **data)
+{
+ int n;
+ int state = 0;
+ char buf[BUFSIZ];
+ int num;
+ char ch;
+ char *s;
+ char *t;
+ PICS_HEAD *result;
+ size_t which = 0;
+ size_t cells = 0;
+
+ debugmsg("called parse_xbm");
+
+ result = typeCalloc(PICS_HEAD, 1);
+ how_much.head += sizeof(PICS_HEAD);
+
+ begin_c_values(2);
+ gather_c_values(0);
+ gather_c_values(0xffffff);
+
+ for (n = 0; data[n] != 0; ++n) {
+ if (strlen(s = data[n]) >= sizeof(buf) - 1)
+ continue;
+ switch (state) {
+ case 0:
+ case 1:
+ case 2:
+ if (sscanf(s, "#define %s %d%c", buf, &num, &ch) >= 2) {
+ if ((t = strstr(buf, "_width")) != 0) {
+ state |= 1;
+ result->wide = (short) bytes_of(num);
+ } else if ((t = strstr(buf, "_height")) != 0) {
+ state |= 2;
+ result->high = (short) num;
+ } else {
+ break;
+ }
+ *t = '\0';
+ if (result->name) {
+ if (strcmp(result->name, buf)) {
+ goto finish;
+ }
+ } else {
+ result->name = strdup(buf);
+ }
+ }
+ break;
+ case 3:
+ if (sscanf(s, "static char %[^_ ]_bits[]%c", buf, &ch) >= 1) {
+ if (strcmp(result->name, buf)) {
+ goto finish;
+ }
+ state = 4;
+ cells = (size_t) (result->wide * result->high);
+
+ result->cells = typeCalloc(PICS_CELL, cells);
+ how_much.cell += (sizeof(PICS_CELL) * cells);
+
+ if ((s = strchr(s, L_CURLY)) == 0)
+ break;
+ ++s;
+ } else {
+ break;
+ }
+ case 4:
+ while (*s != '\0') {
+ while (isspace(UChar(*s))) {
+ ++s;
+ }
+ if (isdigit(UChar(*s))) {
+ long value = strtol(s, &t, 0);
+ int b;
+ if (t != s || value > MaxRGB || value < 0) {
+ s = t;
+ } else {
+ state = -1;
+ goto finish;
+ }
+ for (b = 0; b < 8; ++b) {
+ if (((1L << b) & value) != 0) {
+ result->cells[which].ch = '*';
+ result->cells[which].fg = 1;
+ reading_ncols[1].count++;
+ } else {
+ result->cells[which].ch = ' ';
+ result->cells[which].fg = 0;
+ reading_ncols[0].count++;
+ }
+ if (++which > cells) {
+ state = -1;
+ goto finish;
+ }
+ }
+ }
+ if (*s == R_CURLY) {
+ state = 5;
+ goto finish;
+ } else if (*s == ',') {
+ ++s;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ finish:
+ if (state < 4) {
+ debugmsg("...state was only %d", state);
+ if (result) {
+ result = free_pics_head(result);
+ }
+ } else {
+ finish_c_values(result);
+ }
+ return result;
+}
+
+static PICS_HEAD *
+parse_xpm(char **data)
+{
+ int state = 0;
+ PICS_HEAD *result;
+ RGB_NAME *by_name;
+ int n;
+ int cells = 0;
+ int cpp = 1; /* chars per pixel */
+ int num[6];
+ int found;
+ int which = 0;
+ int num_colors = 0;
+ char ch;
+ const char *cs;
+ char *s;
+ char buf[BUFSIZ];
+ char arg1[BUFSIZ];
+ char arg2[BUFSIZ];
+ char arg3[BUFSIZ];
+ char **list = 0;
+
+ debugmsg("called parse_xpm");
+
+ result = typeCalloc(PICS_HEAD, 1);
+ how_much.head += sizeof(PICS_HEAD);
+
+ for (n = 0; data[n] != 0; ++n) {
+ if (strlen(s = data[n]) >= sizeof(buf) - 1)
+ continue;
+ switch (state) {
+ case 0:
+ if (match_c(s, " /* XPM */ ")) {
+ state = 1;
+ }
+ break;
+ case 1:
+ if (match_c(s, " static char * %s [] = %c ", arg1, &ch) &&
+ ch == L_CURLY) {
+ result->name = strdup(arg1);
+ state = 2;
+ }
+ break;
+ case 2:
+ if (match_c(s, " \" %d %d %d %d \" , ",
+ num + 0, num + 1, num + 2, num + 3) ||
+ match_c(s, " \" %d %d %d %d %d %d \" , ",
+ num + 0, num + 1, num + 2, num + 3, num + 4, num + 5)) {
+ result->wide = (short) num[0];
+ result->high = (short) num[1];
+ result->colors = num[2];
+
+ begin_c_values(num[2]);
+
+ cells = (result->wide * result->high);
+
+ result->cells = typeCalloc(PICS_CELL, cells);
+ how_much.cell += sizeof(PICS_CELL) * (size_t) cells;
+
+ list = typeCalloc(char *, result->colors + 1);
+ how_much.list += sizeof(char *) * (size_t) (result->colors + 1);
+
+ cpp = num[3];
+ state = 3;
+ }
+ break;
+ case 3:
+ if (!match_colors(s, cpp, arg1, arg2, arg3)) {
+ break;
+ }
+ num_colors++;
+ free(list[reading_last]);
+ list[reading_last] = strdup(arg1);
+ if ((by_name = lookup_rgb(arg3)) != 0) {
+ found = gather_c_values(by_name->value);
+ } else if (*arg3 == '#') {
+ char *rgb = arg3 + 1;
+ unsigned long value = strtoul(rgb, &s, 16);
+ switch ((int) strlen(rgb)) {
+ case 6:
+ break;
+ case 12:
+ value = (((value >> 24) & 0xff0000L)
+ | ((value >> 16) & 0xff00L)
+ | ((value >> 8) & 0xffL));
+ break;
+ default:
+ warning("unexpected rgb value %s", rgb);
+ break;
+ }
+ found = gather_c_values((int) value);
+ } else {
+ found = gather_c_values(0); /* actually an error */
+ }
+ debugmsg(" [%d:%d] %06X", num_colors, result->colors,
+ reading_ncols[(found >= 0) ? found : 0].fgcol);
+ if (num_colors >= result->colors) {
+ finish_c_values(result);
+ state = 4;
+ if (list[0] == 0)
+ list[0] = strdup("\033");
+ }
+ break;
+ case 4:
+ if (*(cs = skip_cs(s)) == '"') {
+ ++cs;
+ while (*cs != '\0' && *cs != '"') {
+ int c;
+
+ /* FIXME - factor out */
+ for (c = 0; c < result->colors; ++c) {
+ if (list[c] == 0) {
+ /* should not happen... */
+ continue;
+ }
+ if (!(strncmp) (cs, list[c], (size_t) cpp)) {
+ result->cells[which].ch = list[c][0];
+ result->cells[which].fg = c;
+ result->fgcol[c].count++;
+ break;
+ }
+ }
+
+ if (result->cells[which].ch == 0) {
+ result->cells[which].ch = '?';
+ result->cells[which].fg = 0;
+ }
+
+ if (++which >= cells) {
+ state = 5;
+ break;
+ }
+ for (c = cpp; c > 0; --c, ++cs) {
+ if (*cs == '\0')
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ if (result && list) {
+ for (n = 0; n < result->colors; ++n)
+ free(list[n]);
+ free(list);
+ }
+
+ if (state < 5) {
+ debugmsg("...state was only %d", state);
+ result = free_pics_head(result);
+ }
+
+ if (result) {
+ debugmsg("...allocated %d colors", result->colors);
+ }
+
+ return result;
+}
+
+/*
+ * The obscurely-named "convert" is provided by ImageMagick
+ */
+static PICS_HEAD *
+parse_img(const char *filename)
+{
+ size_t need = strlen(filename) + 256;
+ char *cmd = malloc(need);
+ FILE *pp;
+ char buffer[BUFSIZ];
+ char dummy[BUFSIZ];
+ bool okay = TRUE;
+ PICS_HEAD *result;
+ int pic_x = 0;
+ int pic_y = 0;
+ int width = in_curses ? COLS : 80;
+
+ _nc_SPRINTF(cmd, _nc_SLIMIT(need) "identify \"%s\"", filename);
+ if (quiet)
+ _nc_STRCAT(cmd, " 2>/dev/null", need);
+
+ logmsg("...opening pipe to %s", cmd);
+
+ result = typeCalloc(PICS_HEAD, 1);
+ how_much.head += sizeof(PICS_HEAD);
+
+ if ((pp = popen(cmd, "r")) != 0) {
+ if (fgets(buffer, sizeof(buffer), pp) != 0) {
+ size_t n = strlen(filename);
+ debugmsg2("...read %s", buffer);
+ if (strlen(buffer) > n &&
+ !(strncmp) (buffer, filename, n) &&
+ isspace(UChar(buffer[n])) &&
+ sscanf(skip_word(buffer + n), " %dx%d ", &pic_x, &pic_y) == 2) {
+ /* distort image to make it show normally on terminal */
+ pic_x = (int) ((double) pic_x / aspect_ratio);
+ } else {
+ pic_x = pic_y = 0;
+ }
+ }
+ pclose(pp);
+ }
+ if (pic_x <= 0 || pic_y <= 0)
+ goto finish;
+
+ _nc_SPRINTF(cmd, _nc_SLIMIT(need)
+ "convert " "-resize %dx%d\\! " "-thumbnail %dx \"%s\" "
+ "-define txt:compliance=SVG txt:-",
+ pic_x, pic_y, width, filename);
+ if (quiet)
+ _nc_STRCAT(cmd, " 2>/dev/null", need);
+
+ logmsg("...opening pipe to %s", cmd);
+ if ((pp = popen(cmd, "r")) != 0) {
+ int count = 0;
+ int col = 0;
+ int row = 0;
+ int len = 0;
+ while (fgets(buffer, sizeof(buffer), pp) != 0) {
+ debugmsg2("[%5d] %s", count + 1, buffer);
+ if (strlen(buffer) > 160) { /* 80 columns would be enough */
+ okay = FALSE;
+ break;
+ }
+ if (count++ == 0) {
+ if (match_c(buffer,
+ "# ImageMagick pixel enumeration: %d,%d,%d,%s ",
+ &col, &row, &len, dummy)) {
+ result->name = strdup(filename);
+ result->wide = (short) col;
+ result->high = (short) row;
+
+ begin_c_values(256);
+
+ result->cells = typeCalloc(PICS_CELL, (size_t) (col * row));
+ how_much.cell += (sizeof(PICS_CELL) * (size_t) (col * row));
+ } else {
+ okay = FALSE;
+ break;
+ }
+ } else {
+ /* subsequent lines begin "col,row: (r,g,b,a) #RGB" */
+ int r, g, b, nocolor;
+ unsigned check;
+ char *t;
+ char *s = t = strchr(buffer, '#');
+
+ if (s != 0) {
+ /* after the "#RGB", there are differences - just ignore */
+ while (*s != '\0' && !isspace(UChar(*s)))
+ ++s;
+ *++s = '\0';
+ }
+ if (match_c(buffer,
+ "%d,%d: (%d,%d,%d,%d) #%x ",
+ &col, &row,
+ &r, &g, &b, &nocolor,
+ &check)) {
+ int which, c;
+
+ if ((s - t) > 8) /* 6 hex digits vs 8 */
+ check /= 256;
+ if (r > MaxRGB ||
+ g > MaxRGB ||
+ b > MaxRGB ||
+ check != (unsigned) ((r << 16) | (g << 8) | b)) {
+ okay = FALSE;
+ break;
+ }
+ c = gather_c_values((int) check);
+ which = col + (row * result->wide);
+ result->cells[which].ch = ((in_curses ||
+ check == 0xffffff)
+ ? ' '
+ : '#');
+ if (c >= 0 && c < reading_last) {
+ result->cells[which].fg = c;
+ reading_ncols[c].count++;
+ } else {
+ result->cells[which].fg = -1;
+ }
+ } else {
+ okay = FALSE;
+ break;
+ }
+ }
+ }
+ finish_c_values(result);
+ pclose(pp);
+ if (okay) {
+ /* FIXME - is this trimming needed? */
+ for (len = result->colors; len > 3; len--) {
+ if (result->fgcol[len - 1].fgcol == 0) {
+ result->colors = len - 1;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ finish:
+ free(cmd);
+
+ if (!okay) {
+ result = free_pics_head(result);
+ }
+
+ return result;
+}
+
+static PICS_HEAD *
+read_picture(const char *filename, char **data)
+{
+ PICS_HEAD *pics;
+ if ((pics = parse_xbm(data)) == 0) {
+ dispose_c_values();
+ if ((pics = parse_xpm(data)) == 0) {
+ dispose_c_values();
+ if ((pics = parse_img(filename)) == 0) {
+ dispose_c_values();
+ free_data(data);
+ warning("unexpected file-format for \"%s\"", filename);
+ } else if (pics->high == 0 || pics->wide == 0) {
+ dispose_c_values();
+ free_data(data);
+ pics = free_pics_head(pics);
+ warning("no picture found in \"%s\"", filename);
+ }
+ }
+ }
+ return pics;
+}
+
+#define fg_color(pics,n) (pics->fgcol[n].fgcol)
+
+static void
+dump_picture(PICS_HEAD * pics)
+{
+ int y, x;
+
+ printf("Name %s\n", pics->name);
+ printf("Size %dx%d\n", pics->high, pics->wide);
+ printf("Color\n");
+ for (y = 0; y < pics->colors; ++y) {
+ if (fg_color(pics, y) < 0) {
+ printf(" %3d: %d\n", y, fg_color(pics, y));
+ } else {
+ printf(" %3d: #%06x\n", y, fg_color(pics, y));
+ }
+ }
+ for (y = 0; y < pics->high; ++y) {
+ for (x = 0; x < pics->wide; ++x) {
+ putchar(pics->cells[y * pics->wide + x].ch);
+ }
+ putchar('\n');
+ }
+}
+
+#ifndef USE_DISPLAY_DRIVER
+static void
+init_display(const char *palette_path, int opt_d)
+{
+ (void) opt_d;
+ if (isatty(fileno(stdout))) {
+ in_curses = TRUE;
+ initscr();
+ cbreak();
+ noecho();
+ curs_set(0);
+ if (has_colors()) {
+ start_color();
+#if HAVE_USE_DEFAULT_COLORS
+ if (opt_d)
+ use_default_colors();
+#endif
+ init_palette(palette_path);
+ }
+ scrollok(stdscr, FALSE);
+ stop_curses();
+ }
+}
+
+static void
+show_picture(PICS_HEAD * pics)
+{
+ int y, x;
+ int n;
+
+ debugmsg("called show_picture");
+ logmsg("...using %dx%d screen", LINES, COLS);
+#if HAVE_RESET_COLOR_PAIRS
+ reset_color_pairs();
+#elif HAVE_CURSCR
+ wclear(curscr);
+ clear();
+#endif
+ if (has_colors()) {
+ logmsg("...using %d colors", pics->colors);
+ for (n = 0; n < pics->colors; ++n) {
+ int my_pair = (n + 1);
+ int my_color = map_color(fg_color(pics, n));
+#if USE_EXTENDED_COLORS
+ if (use_extended_pairs) {
+ init_extended_pair(my_pair, my_color, my_color);
+ } else
+#endif
+ {
+ my_pair &= 0x7fff;
+ my_color &= 0x7fff;
+ init_pair((short) my_pair, (short) my_color, (short) my_color);
+ }
+ }
+ attrset(COLOR_PAIR(1));
+ erase();
+ }
+ for (y = 0; y < pics->high; ++y) {
+ if (y >= LINES)
+ break;
+ move(y, 0);
+
+ for (x = 0; x < pics->wide; ++x) {
+ int my_pair;
+
+ if (x >= COLS)
+ break;
+ n = (y * pics->wide + x);
+ my_pair = pics->cells[n].fg + 1;
+#if USE_EXTENDED_COLORS
+ if (use_extended_pairs) {
+ cchar_t temp;
+ wchar_t wch[2];
+ wch[0] = (wchar_t) pics->cells[n].ch;
+ wch[1] = 0;
+ setcchar(&temp, wch, A_NORMAL, (short) my_pair, &my_pair);
+ add_wch(&temp);
+ } else
+#endif
+ {
+ attrset(COLOR_PAIR(my_pair));
+ addch((chtype) pics->cells[n].ch);
+ }
+ }
+ }
+ if (slow_time >= 0) {
+ refresh();
+ if (slow_time > 0) {
+#ifdef NCURSES_VERSION
+ napms(1000 * slow_time);
+#else
+ sleep((unsigned) slow_time);
+#endif
+ }
+ } else {
+ wmove(stdscr, 0, 0);
+ getch();
+ }
+ if (!quiet)
+ endwin();
+}
+#endif
+
+static int
+compare_fg_counts(const void *a, const void *b)
+{
+ const FG_NODE *p = (const FG_NODE *) a;
+ const FG_NODE *q = (const FG_NODE *) b;
+ return (q->count - p->count);
+}
+
+static void
+report_colors(PICS_HEAD * pics)
+{
+ int accum;
+ double level;
+ int j;
+ int shift;
+ int total;
+ char buffer[256];
+
+ if (logfp == 0)
+ return;
+
+ qsort(pics->fgcol, (size_t) pics->colors, sizeof(FG_NODE), compare_fg_counts);
+ /*
+ * For debugging, show a (short) list of the colors used.
+ */
+ if (debugging && (pics->colors < 1000)) {
+ int digits = 0;
+ int high;
+ int wide = 4;
+ for (j = pics->colors; j != 0; j /= 10) {
+ ++digits;
+ if (j < 10)
+ ++digits;
+ }
+ if (digits > 8)
+ digits = 8;
+ logmsg("These colors were used:");
+ high = (pics->colors + wide - 1) / wide;
+ for (j = 0; j < high && j < pics->colors; ++j) {
+ int k;
+ char *s = buffer;
+ *s = '\0';
+ for (k = 0; k < wide; ++k) {
+ int n = j + (k * high);
+ size_t want = (sizeof(buffer) - (size_t) (s - buffer));
+ if (want < 100)
+ break;
+ if (n >= pics->colors)
+ break;
+ if (k) {
+ *s++ = ' ';
+ if (digits < 8) {
+ _nc_SPRINTF(s, _nc_SLIMIT(want) "%*s", 8 - digits,
+ " ");
+ s += strlen(s);
+ }
+ }
+ if (pics->fgcol[n].fgcol >= 0) {
+ _nc_SPRINTF(s, _nc_SLIMIT(want) "%3d #%06X %*d", n,
+ pics->fgcol[n].fgcol,
+ digits, pics->fgcol[n].count);
+ } else {
+ _nc_SPRINTF(s, _nc_SLIMIT(want) "%3d (empty) %*d", n,
+ digits, pics->fgcol[n].count);
+ }
+ s += strlen(s);
+ if ((s - buffer) > 100)
+ break;
+ }
+ logmsg("%s", buffer);
+ }
+ }
+
+ /*
+ * Given the list of colors sorted by the number of times they are used,
+ * log a short report showing the number of colors for 90%, 99%, 99.9%,
+ * etc.
+ */
+ logmsg("Number of colors versus number of cells");
+ total = pics->high * pics->wide;
+ accum = 0;
+ level = 0.1;
+ shift = 1;
+ for (j = 0; j < pics->colors; ++j) {
+ accum += pics->fgcol[j].count;
+ if (accum >= (total * (1.0 - level))) {
+ int after = (shift > 2) ? shift - 2 : 0;
+ logmsg("%8d colors (%.1f%%) in %d cells (%.*f%%)",
+ j + 1,
+ (100.0 * (j + 1)) / pics->colors,
+ accum,
+ after, (100.0 * accum) / total);
+ if (accum >= total)
+ break;
+ level /= 10.0;
+ shift++;
+ }
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ int n;
+ int opt_d = FALSE;
+ char ignore_ch;
+ const char *palette_path = 0;
+ const char *rgb_path = RGB_PATH;
+
+ while ((n = getopt(argc, argv, "a:dLl:p:qr:s:x:")) != -1) {
+ switch (n) {
+ case 'a':
+ if (sscanf(optarg, "%lf%c", &aspect_ratio, &ignore_ch) != 1
+ || aspect_ratio < 0.1
+ || aspect_ratio > 10.) {
+ fprintf(stderr, "Expected a number in [0.1 to 10.]: %s\n", optarg);
+ usage();
+ }
+ break;
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ opt_d = TRUE;
+ break;
+#endif
+ case 'L':
+ debugging = TRUE;
+ break;
+ case 'l':
+ if ((logfp = fopen(optarg, "a")) == 0)
+ failed(optarg);
+ break;
+ case 'p':
+ palette_path = optarg;
+ break;
+ case 'q':
+ quiet = TRUE;
+ break;
+ case 'r':
+ rgb_path = optarg;
+ break;
+ case 's':
+ slow_time = atoi(optarg);
+ break;
+#if USE_EXTENDED_COLORS
+ case 'x':
+ {
+ char *s = optarg;
+ while (*s) {
+ switch (*s++) {
+ case 'p':
+ use_extended_pairs = TRUE;
+ break;
+ case 'c':
+ use_extended_colors = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+ }
+ break;
+#endif
+ default:
+ usage();
+ break;
+ }
+ }
+
+ if (optind < argc) {
+ char **rgb_data = read_file(rgb_path);
+
+ if (rgb_data)
+ rgb_table = parse_rgb(rgb_data);
+
+ init_display(palette_path, opt_d);
+ if (optind >= argc)
+ giveup("expected at least one image filename");
+
+ for (n = optind; n < argc; ++n) {
+ PICS_HEAD *pics;
+ char **data = read_file(argv[n]);
+
+ if (data == 0) {
+ warning("cannot read \"%s\"", argv[n]);
+ continue;
+ }
+ if ((pics = read_picture(argv[n], data)) != 0) {
+ if (in_curses) {
+ show_picture(pics);
+ } else {
+ dump_picture(pics);
+ }
+ report_colors(pics);
+ dispose_c_values();
+ free_data(data);
+ free_pics_head(pics);
+ }
+ }
+ free_data(rgb_data);
+ free(rgb_table);
+ free(all_colors);
+ } else {
+ usage();
+ }
+
+ cleanup(EXIT_SUCCESS);
+}
diff --git a/test/picsmap.h b/test/picsmap.h
new file mode 100644
index 0000000..bdeb3c3
--- /dev/null
+++ b/test/picsmap.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey *
+ ****************************************************************************/
+/* $Id: picsmap.h,v 1.4 2020/02/02 23:34:34 tom Exp $ */
+
+#ifndef PICSMAP_H_INCL
+#define PICSMAP_H_INCL 1
+
+typedef int NUM_COLOR;
+typedef unsigned short NUM_COUNT;
+
+typedef struct {
+ char ch; /* nominal character to display */
+ NUM_COLOR fg; /* foreground color */
+} PICS_CELL;
+
+typedef struct {
+ NUM_COLOR fgcol;
+ NUM_COUNT count;
+} FG_NODE;
+
+typedef struct {
+ char *name;
+ short high;
+ short wide;
+ int colors;
+ FG_NODE *fgcol;
+ PICS_CELL *cells;
+} PICS_HEAD;
+
+typedef struct {
+ const char *name;
+ int value;
+} RGB_NAME;
+
+typedef struct {
+ short red;
+ short green;
+ short blue;
+} RGB_DATA;
+
+static void init_display(const char *, int);
+
+static void show_picture(PICS_HEAD * pics);
+
+#endif /* PICSMAP_H_INCL */
diff --git a/test/popup_msg.c b/test/popup_msg.c
new file mode 100644
index 0000000..5c0e5ba
--- /dev/null
+++ b/test/popup_msg.c
@@ -0,0 +1,184 @@
+/****************************************************************************
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 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.10 2020/02/02 23:34:34 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>
+
+#if HAVE_NEWPAD
+
+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) {
+ delwin(help);
+ 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);
+}
+
+#else
+void
+popup_msg(WINDOW *parent, const char *const *msg)
+{
+ (void) parent;
+ (void) msg;
+ beep();
+}
+#endif
diff --git a/test/popup_msg.h b/test/popup_msg.h
new file mode 100644
index 0000000..88dff73
--- /dev/null
+++ b/test/popup_msg.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 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.5 2020/02/02 23:34:34 tom Exp $
+ *
+ * Utility functions for a popup-message or help-screen.
+ */
+
+#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 */
diff --git a/test/programs b/test/programs
index 1110ce5..beb0dfa 100644
--- a/test/programs
+++ b/test/programs
@@ -1,6 +1,7 @@
-# $Id: programs,v 1.25 2014/06/21 15:28:49 tom Exp $
+# $Id: programs,v 1.45 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 2006-2013,2014 Free Software Foundation, Inc. #
+# Copyright 2018-2019,2020 Thomas E. Dickey #
+# Copyright 2006-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"), #
@@ -30,19 +31,22 @@
# Author: Thomas E. Dickey
#
# programs used for ncurses tests
-background $(LDFLAGS_CURSES) $(LOCAL_LIBS) background
+background $(LDFLAGS_CURSES) $(LOCAL_LIBS) background dump_window
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_content $(LDFLAGS_CURSES) $(LOCAL_LIBS) color_content
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 popup_msg
demo_panels $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_panels
+demo_tabs $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_tabs
demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap
demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo
ditto $(LDFLAGS_THREADS) $(LOCAL_LIBS) ditto
@@ -50,48 +54,58 @@ dots $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots
dots_curses $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_curses
dots_mvcur $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_mvcur
dots_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots_termcap
+dots_xcurses $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_xcurses
echochar $(LDFLAGS_CURSES) $(LOCAL_LIBS) echochar
+extended_color $(LDFLAGS_CURSES) $(LOCAL_LIBS) extended_color
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
+padview $(LDFLAGS_CURSES) $(LOCAL_LIBS) padview popup_msg
+pair_content $(LDFLAGS_CURSES) $(LOCAL_LIBS) pair_content
+picsmap $(LDFLAGS_CURSES) $(LOCAL_LIBS) picsmap
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
test_addchstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addchstr
test_addstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addstr
test_addwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addwstr
test_arrays $(LDFLAGS_TINFO) $(LOCAL_LIBS) test_arrays
-test_get_wstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_get_wstr
-test_getstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_getstr
+test_get_wstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_get_wstr popup_msg
+test_getstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_getstr popup_msg
test_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr
test_inwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_inwstr
test_opaque $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_opaque
+test_setupterm $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_setupterm
+test_sgr $(LDFLAGS_TINFO) $(LOCAL_LIBS) test_sgr
+test_termattrs $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_termattrs
test_vid_puts $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vid_puts
test_vidputs $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vidputs
testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch
testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs
testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw
-view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view
+view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view popup_msg
worm $(LDFLAGS_THREADS) $(LOCAL_LIBS) worm
xmas $(LDFLAGS_CURSES) $(LOCAL_LIBS) xmas
diff --git a/test/railroad.c b/test/railroad.c
index 33dc46f..e3558b0 100644
--- a/test/railroad.c
+++ b/test/railroad.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2000-2011,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2000-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 *
@@ -29,7 +30,7 @@
/*
* Author: Thomas E. Dickey - 2000
*
- * $Id: railroad.c,v 1.21 2013/09/28 22:02:17 tom Exp $
+ * $Id: railroad.c,v 1.24 2020/02/02 23:34:34 tom Exp $
*
* A simple demo of the termcap interface.
*/
@@ -113,7 +114,7 @@ static void
ShowSign(char *string)
{
char *base = string;
- int ch, first, last;
+ int first, last;
if (moveit != 0) {
tputs(tgoto(moveit, 0, height - 1), 1, outc);
@@ -121,7 +122,7 @@ ShowSign(char *string)
}
while (*string != 0) {
- ch = *string;
+ int ch = *string;
if (ch != ' ') {
if (moveit != 0) {
for (first = length - 2; first >= (string - base); first--) {
@@ -187,10 +188,13 @@ railroad(char **args)
NCURSES_CONST char *name = getenv("TERM");
char buffer[1024];
char area[1024], *ap = area;
+ int z;
if (name == 0)
name = "dumb";
- if (tgetent(buffer, name) >= 0) {
+
+ InitAndCatch(z = tgetent(buffer, name), onsig);
+ if (z >= 0) {
wipeit = tgetstr("ce", &ap);
height = tgetnum("li");
@@ -220,8 +224,6 @@ railroad(char **args)
MyShowCursor(0);
- CATCHALL(onsig);
-
while (*args) {
ShowSign(*args++);
}
diff --git a/test/rain.c b/test/rain.c
index 0f123ba..14a536b 100644
--- a/test/rain.c
+++ b/test/rain.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,9 +27,10 @@
* authorization. *
****************************************************************************/
/*
- * $Id: rain.c,v 1.41 2014/08/02 17:24:07 tom Exp $
+ * $Id: rain.c,v 1.51 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
+#include <popup_msg.h>
/* rain 11/3/1980 EPS/CITHEP */
@@ -66,11 +68,18 @@ typedef struct {
static STATS drop_threads[MAX_THREADS];
#endif
+#if HAVE_USE_WINDOW
+static int
+safe_wgetch(WINDOW *w, void *data GCC_UNUSED)
+{
+ return wgetch(w);
+}
+#endif
+
static void
onsig(int n GCC_UNUSED)
{
- curs_set(1);
- endwin();
+ stop_curses();
ExitProgram(EXIT_FAILURE);
}
@@ -219,7 +228,7 @@ draw_drop(void *arg)
* Find myself in the list of threads so we can count the number of loops.
*/
for (mystats = 0; mystats < MAX_THREADS; ++mystats) {
-#if defined(__MINGW32__) && !defined(__WINPTHREADS_VERSION)
+#if defined(_WIN32) && !defined(__WINPTHREADS_VERSION)
if (drop_threads[mystats].myself.p == pthread_self().p)
#else
if (drop_threads[mystats].myself == pthread_self())
@@ -285,30 +294,76 @@ start_drop(DATA * data)
static int
get_input(void)
{
- return USING_WINDOW(stdscr, wgetch);
+ return USING_WINDOW1(stdscr, wgetch, safe_wgetch);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: rain [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
}
int
-main(int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
+ 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
DATA last[MAX_DROP];
#endif
int j = 0;
+ int ch;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
- setlocale(LC_ALL, "");
+ while ((ch = getopt(argc, argv, "d")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ if (optind < argc)
+ usage();
- CATCHALL(onsig);
+ setlocale(LC_ALL, "");
- initscr();
+ InitAndCatch(initscr(), onsig);
if (has_colors()) {
int bg = COLOR_BLACK;
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (d_option && (use_default_colors() == OK))
bg = -1;
#endif
init_pair(1, COLOR_BLUE, (short) bg);
@@ -373,11 +428,17 @@ main(int argc GCC_UNUSED,
case (KEY_RESIZE):
break;
#endif
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
+ case ERR:
+ break;
+ default:
+ beep();
}
napms(50);
}
- curs_set(1);
- endwin();
+ stop_curses();
#ifdef USE_PTHREADS
printf("Counts per thread:\n");
for (j = 0; j < MAX_THREADS; ++j)
diff --git a/test/redraw.c b/test/redraw.c
index 9cb0de9..569c276 100644
--- a/test/redraw.c
+++ b/test/redraw.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2006-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -26,13 +27,14 @@
* authorization. *
****************************************************************************/
/*
- * $Id: redraw.c,v 1.8 2012/12/08 20:46:02 tom Exp $
+ * $Id: redraw.c,v 1.11 2020/02/02 23:34:34 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 +55,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 +98,7 @@ test_redraw(WINDOW *win)
switch (ch) {
case 'q':
/* FALLTHRU */
+ case QUIT:
case ESCAPE:
done = TRUE;
break;
@@ -146,9 +168,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)));
}
@@ -159,10 +186,52 @@ test_redraw(WINDOW *win)
}
}
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: redraw [options]"
+ ,""
+ ,"Options:"
+ ," -e use stderr (default stdout)"
+ ," -n do not initialize terminal"
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(tbl); ++n)
+ fprintf(stderr, "%s\n", tbl[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
- initscr();
+ int ch;
+ bool no_init = FALSE;
+ FILE *my_fp = stdout;
+
+ while ((ch = getopt(argc, argv, "en")) != -1) {
+ switch (ch) {
+ case 'e':
+ my_fp = stderr;
+ break;
+ case 'n':
+ no_init = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+ if (optind < argc)
+ usage();
+
+ if (no_init) {
+ START_TRACE();
+ } else {
+ newterm((char *) 0, my_fp, stdin);
+ }
+
raw();
noecho();
test_redraw(stdscr);
diff --git a/test/savescreen.c b/test/savescreen.c
index 111882d..da00d75 100644
--- a/test/savescreen.c
+++ b/test/savescreen.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2010,2011 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2006-2017,2018 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,31 +27,47 @@
* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.15 2011/01/15 18:15:11 tom Exp $
+ * $Id: savescreen.c,v 1.57 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
*/
+#define NEED_TIME_H
#include <test.priv.h>
+#include <popup_msg.h>
+#include <parse_rgb.h>
#if HAVE_SCR_DUMP
#include <sys/types.h>
#include <sys/stat.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
+#if defined(__hpux)
+#define MyMarker 'X'
#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
+#define MyMarker ACS_DIAMOND
#endif
+#define MAX_ANSI 8
+
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[CCHARW_MAX];
+ wchar_t result = 0;
+ attr_t my_attr;
+ short my_pair;
+ if (getcchar(&data, my_wchar, &my_attr, &my_pair, NULL) == OK)
+ result = my_wchar[0];
+ return result;
+}
+#endif
static int
fexists(const char *name)
@@ -71,8 +88,10 @@ cleanup(char *files[])
{
int n;
- for (n = 0; files[n] != 0; ++n) {
- unlink(files[n]);
+ if (!keep_dumps) {
+ for (n = 0; files[n] != 0; ++n) {
+ unlink(files[n]);
+ }
}
}
@@ -103,15 +122,27 @@ after_load(void)
}
static void
-show_what(int which, int last)
+show_what(int color, int which, int last)
{
- int y, x;
- time_t now = time((time_t *) 0);
+ int y, x, n;
+ time_t now;
+ char *mytime;
getyx(stdscr, y, x);
move(0, 0);
- printw("Saved %d of %d - %s", which, last + 1, ctime(&now));
+ printw("Color %d. Saved %d of %d (? for help)", color, which, last + 1);
+
+ now = time((time_t *) 0);
+ mytime = ctime(&now);
+ for (n = (int) strlen(mytime) - 1; n >= 0; --n) {
+ if (isspace(UChar(mytime[n]))) {
+ mytime[n] = '\0';
+ } else {
+ break;
+ }
+ }
+ mvprintw(0, (COLS - n - 2), " %s", mytime);
move(y, x);
@@ -119,20 +150,109 @@ show_what(int which, int last)
}
static int
-get_command(int which, int last)
+get_command(int color, int which, int last)
{
int ch;
- timeout(100);
+ timeout(50);
do {
- show_what(which, last);
+ show_what(color, which, last);
ch = getch();
} while (ch == ERR);
return ch;
}
+static int
+dump_screen(char **files, int color, int which, int last, bool use_colors)
+{
+#if USE_WIDEC_SUPPORT
+ cchar_t mycc;
+ int myxx;
+#endif
+ char *filename = files[which];
+ bool dumped = FALSE;
+
+ if (filename != 0) {
+ dumped = TRUE;
+ show_what(color, ++which, last);
+ if (scr_dump(filename) == ERR) {
+ endwin();
+ printf("Cannot write screen-dump %s\n", filename);
+ cleanup(files);
+ ExitProgram(EXIT_SUCCESS);
+ }
+ if (use_colors) {
+ int cx, cy;
+ int pair = 1 + (which % MAX_ANSI);
+ /*
+ * Change the background color, to make it more obvious. But that
+ * changes the existing text-color. Copy the old values from the
+ * currently displayed screen.
+ */
+ bkgd((chtype) COLOR_PAIR(pair));
+ for (cy = 1; cy < LINES; ++cy) {
+ for (cx = 0; cx < COLS; ++cx) {
+ wmove(curscr, cy, cx);
+ wmove(stdscr, cy, cx);
+#if USE_WIDEC_SUPPORT
+ if (win_wch(curscr, &mycc) != ERR) {
+ myxx = wcwidth(BaseChar(mycc));
+ if (myxx > 0) {
+ wadd_wchnstr(stdscr, &mycc, 1);
+ cx += (myxx - 1);
+ }
+ }
+#else
+ waddch(stdscr, winch(curscr));
+#endif
+ }
+ }
+ }
+ }
+ return dumped;
+}
+
+static void
+editor_help(void)
+{
+ static const char *msgs[] =
+ {
+ "You are now in the screen-editor, which allows you to make some",
+ "lines on the screen, as well as save copies of the screen to a",
+ "temporary file",
+ "",
+ "Keys:",
+ " q quit",
+ " n run the screen-loader to show the saved screens",
+ " <space> dump a screen",
+ "",
+ " 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
+ };
+ popup_msg(stdscr, msgs);
+}
+
+static void
+replay_help(void)
+{
+ static const char *msgs[] =
+ {
+ "You are now in the screen-loader, which allows you to view",
+ "the dumped/restored screens.",
+ "",
+ "Keys:",
+ " q quit",
+ " <space> load the next screen",
+ " <backspace> load the previous screen",
+ 0
+ };
+ popup_msg(stdscr, msgs);
+}
+
static void
usage(void)
{
@@ -141,8 +261,10 @@ usage(void)
"Usage: savescreen [-r] files",
"",
"Options:",
- " -i use scr_init/scr_restore rather than scr_set",
- " -r replay the screen-dump files"
+ " -f file fill/initialize screen using text from this file",
+ " -i use scr_init/scr_restore rather than scr_set",
+ " -k keep the restored dump-files rather than removing them",
+ " -r replay the screen-dump files"
};
unsigned n;
for (n = 0; n < SIZEOF(msg); ++n) {
@@ -157,15 +279,35 @@ main(int argc, char *argv[])
int ch;
int which = 0;
int last;
+ bool use_colors = FALSE;
bool replaying = FALSE;
bool done = FALSE;
char **files;
+ char *fill_by = 0;
+#if USE_WIDEC_SUPPORT
+ int r, g, b;
+ int cube = 0;
+ int cube0 = 16;
+ int cube1;
+ cchar_t mycc;
+ static const wchar_t mywc[2] =
+ {L'#', 0};
+ bool using_rgb = FALSE;
+#endif
+
+ setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "ir")) != -1) {
+ while ((ch = getopt(argc, argv, "f:ikr")) != -1) {
switch (ch) {
+ case 'f':
+ fill_by = optarg;
+ break;
case 'i':
use_init = TRUE;
break;
+ case 'k':
+ keep_dumps = TRUE;
+ break;
case 'r':
replaying = TRUE;
break;
@@ -188,11 +330,175 @@ main(int argc, char *argv[])
noecho();
keypad(stdscr, TRUE);
curs_set(0);
- if (has_colors()) {
- start_color();
- for (ch = 0; ch < COLOR_PAIRS; ++ch) {
- short pair = (short) (ch % COLOR_PAIRS);
- init_pair(pair, COLOR_WHITE, (short) (ch % COLORS));
+
+ if (has_colors() && (start_color() == OK) && COLORS >= MAX_ANSI) {
+ static const struct {
+ int fg, bg;
+ } table[MAX_ANSI] = {
+#define DATA(fg,bg) { COLOR_##fg, COLOR_##bg }
+ DATA(RED, WHITE),
+ DATA(GREEN, WHITE),
+ DATA(YELLOW, BLACK),
+ DATA(BLUE, WHITE),
+ DATA(MAGENTA, WHITE),
+ DATA(MAGENTA, BLACK),
+ DATA(CYAN, WHITE),
+ DATA(CYAN, BLACK),
+#undef DATA
+ };
+ int n;
+ int pair = 1;
+
+ use_colors = TRUE;
+ /*
+ * Discounting color-pair 0 (no color), make the next 8 color pairs
+ * useful for leaving a visually distinct trail of characters on the
+ * screen.
+ */
+ for (n = 0; n < MAX_ANSI; ++n) {
+ init_pair((short) pair++, (short) table[n].fg, (short) table[n].bg);
+ }
+ /*
+ * After that, use color pairs for constructing a test-pattern, e.g.,
+ * imitating xterm's scripts.
+ */
+ if (fill_by == 0) {
+ if (COLORS <= 256) {
+ for (n = 0; n < COLORS; ++n)
+ init_pair((short) (n + MAX_ANSI), (short) n, (short) n);
+ }
+#if HAVE_TIGETSTR && USE_WIDEC_SUPPORT
+ else {
+ int r_max, g_max, b_max;
+
+ if (parse_rgb(&r_max, &g_max, &b_max) > 0) {
+ int rows = LINES - 1;
+ int cols = COLS - 1;
+ int b_delta = (b_max / rows);
+ int r_delta = (r_max / cols);
+ int g_delta = (g_max / cols);
+ int row = 0;
+
+ b = 0;
+ using_rgb = TRUE;
+ while (row++ < rows) {
+ int col = 0;
+ r = 0;
+ g = g_max;
+ while (col++ < cols) {
+ int color = (((r * (g_max + 1)) + g) * (b_max + 1)
+ + b + MAX_ANSI);
+#if USE_EXTENDED_COLOR
+ init_extended_pair(pair, color, color);
+#else
+ init_pair(pair, color, color);
+#endif
+ pair++;
+ r += r_delta;
+ g -= g_delta;
+ }
+ b += b_delta;
+ }
+ }
+ }
+#endif
+ }
+ if ((fill_by == 0) && !replaying) {
+ /*
+ * Originally (before wide-characters) ncurses supported 16 colors.
+ */
+ if (COLORS >= 16 && COLORS <= 256) {
+ mvprintw(2, 0, "System colors:\n");
+ for (n = 0; n < 16; ++n) {
+ pair = n + MAX_ANSI;
+ addch((chtype) (' ' | COLOR_PAIR(pair)));
+ addch((chtype) (' ' | COLOR_PAIR(pair)));
+ if (((n + 1) % 8) == 0)
+ addch('\n');
+ }
+ }
+ /*
+ * Even with ncurses, you need wide-character support to have more
+ * than 16 colors.
+ */
+#if USE_WIDEC_SUPPORT
+ if (COLORS == 88) {
+ cube = 4;
+ } else if (COLORS == 256) {
+ cube = 6;
+ }
+ if (cube != 0) {
+ cube0 = 16;
+ cube1 = cube0 + (cube * cube * cube);
+
+ addch('\n');
+ printw("Color cube, %dx%dx%d:\n", cube, cube, cube);
+ for (g = 0; g < cube; g++) {
+ for (r = 0; r < cube; r++) {
+ for (b = 0; b < cube; b++) {
+ pair = MAX_ANSI
+ + 16
+ + (r * cube * cube) + (g * cube) + b;
+ setcchar(&mycc, mywc, 0, (short) pair, NULL);
+ add_wch(&mycc);
+ add_wch(&mycc);
+ }
+ addch(' ');
+ }
+ addch('\n');
+ }
+ addch('\n');
+ printw("Grayscale ramp:\n");
+ for (n = cube1; n < COLORS; ++n) {
+ pair = n + MAX_ANSI;
+ setcchar(&mycc, mywc, 0, (short) pair, NULL);
+ add_wch(&mycc);
+ add_wch(&mycc);
+ }
+ } else if ((COLORS > 256) && using_rgb) {
+ int rows = LINES - 1;
+ int cols = COLS - 1;
+ int row = 0;
+
+ b = 0;
+ pair = MAX_ANSI;
+ while (row++ < rows) {
+ int col = 0;
+ while (col++ < cols) {
+ setcchar(&mycc, mywc, 0, (short) pair, &pair);
+ add_wch(&mycc);
+ ++pair;
+ }
+ addch('\n');
+ }
+ addch('\n');
+ }
+#endif
+ }
+ }
+
+ if (fill_by != 0) {
+ FILE *fp = fopen(fill_by, "r");
+ if (fp != 0) {
+ bool filled = FALSE;
+ move(1, 0);
+ while ((ch = fgetc(fp)) != EOF) {
+ if (addch(UChar(ch)) == ERR) {
+ filled = TRUE;
+ break;
+ }
+ }
+ fclose(fp);
+ if (!filled) {
+ while (addch(' ') != ERR) {
+ ;
+ }
+ }
+ move(0, 0);
+ } else {
+ stop_curses();
+ fprintf(stderr, "Cannot open \"%s\"\n", fill_by);
+ ExitProgram(EXIT_FAILURE);
}
}
@@ -202,14 +508,14 @@ main(int argc, char *argv[])
* Use the last file as the initial/current screen.
*/
if (last < 0) {
- endwin();
+ stop_curses();
printf("No screen-dumps given\n");
ExitProgram(EXIT_FAILURE);
}
which = last;
if (load_screen(files[which]) == ERR) {
- endwin();
+ stop_curses();
printf("Cannot load screen-dump %s\n", files[which]);
ExitProgram(EXIT_FAILURE);
}
@@ -227,7 +533,6 @@ main(int argc, char *argv[])
done = TRUE;
break;
case 'q':
- endwin();
cleanup(files);
done = TRUE;
break;
@@ -240,6 +545,9 @@ main(int argc, char *argv[])
if (++which > last)
which = 0;
break;
+ case HELP_KEY_1:
+ replay_help();
+ break;
default:
beep();
continue;
@@ -256,46 +564,34 @@ main(int argc, char *argv[])
wrefresh(curscr);
}
}
+ endwin();
} else {
- int y;
- int x;
-
- move(2, 0);
- printw("Use h,j,k,l or arrows to move around the screen\n");
- printw("Press 'q' to quit, ' ' to dump a screen\n");
- printw("When the last screen has been dumped, press 'n' to run the\n");
- printw("screen-loader. That allows only 'q', backspace and ' ' for\n");
- printw("stepping through the dumped/restored screens.\n");
- getyx(stdscr, y, x);
+ int y = 0;
+ int x = 0;
+ int color = 0;
+ int altchars = 0;
+ bool dirty = use_colors || (fill_by != 0);
while (!done) {
- switch (get_command(which, last)) {
+ switch (get_command(color, which, last)) {
case 'n':
+ if (dirty && files[which]) {
+ dump_screen(files, color, which, last, use_colors);
+ }
setup_next();
done = TRUE;
break;
case 'q':
- endwin();
cleanup(files);
done = TRUE;
break;
case ' ':
- if (files[which] != 0) {
- show_what(which + 1, last);
- if (scr_dump(files[which]) == ERR) {
- endwin();
- printf("Cannot write screen-dump %s\n", files[which]);
- cleanup(files);
- done = TRUE;
- break;
- }
- ++which;
- if (has_colors()) {
- short pair = (short) (which % COLOR_PAIRS);
- bkgd((chtype) COLOR_PAIR(pair));
- }
+ if (dump_screen(files, color, which, last, use_colors)) {
+ which = (which + 1) % MAX_ANSI;
+ dirty = FALSE;
} else {
- beep();
+ setup_next();
+ done = TRUE;
}
break;
case KEY_LEFT:
@@ -318,23 +614,41 @@ main(int argc, char *argv[])
if (++x >= COLS)
x = 0;
break;
+ case 'a':
+ altchars = !altchars;
+ break;
+ case 'c':
+ if (use_colors) {
+ color = (color + 1) % MAX_ANSI;
+ }
+ break;
+ case HELP_KEY_1:
+ editor_help();
+ break;
+ default:
+ beep();
+ continue;
}
if (!done) {
- time_t now = time((time_t *) 0);
-
- move(0, 0);
- addstr(ctime(&now));
+ chtype attr = A_REVERSE;
+ chtype ch2 = (altchars ? MyMarker : '#');
+ if (use_colors) {
+ attr |= (chtype) COLOR_PAIR(color);
+ }
move(y, x);
- addch('#' | A_REVERSE);
+ AddCh(ch2 | attr);
move(y, x);
+ dirty = TRUE;
}
}
+ endwin();
}
ExitProgram(EXIT_SUCCESS);
}
+
#else
int
-main(int argc, char *argv[])
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
printf("This program requires the screen-dump functions\n");
ExitProgram(EXIT_FAILURE);
diff --git a/test/savescreen.sh b/test/savescreen.sh
index e49aa17..4a15ce4 100755
--- a/test/savescreen.sh
+++ b/test/savescreen.sh
@@ -1,6 +1,7 @@
#!/bin/sh
##############################################################################
-# Copyright (c) 2007,2009 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2007-2009,2018 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"), #
@@ -26,14 +27,23 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: savescreen.sh,v 1.4 2009/10/10 17:08:45 tom Exp $
+# $Id: savescreen.sh,v 1.6 2020/02/02 23:34:34 tom Exp $
#
# Use this script to exercise "savescreen".
# It starts by generating a series of temporary-filenames, which are passed
# to the test-program. Loop as long as the first file named exists.
+
+: ${TMPDIR:=/tmp}
+
+# "mktemp -d" would be preferable, but is not standard.
+MY_DIR=$TMPDIR/savescreen$$
+trap "rm -rf $MY_DIR" EXIT INT QUIT HUP
+umask 077
+mkdir $MY_DIR || exit 1
+
PARAMS=
NFILES=4
-PREFIX=savescreen-$$
+PREFIX=$MY_DIR/savescreen
n=0
BEGINS=$PREFIX-$n.tmp
while test $n != $NFILES
@@ -43,12 +53,12 @@ do
n=`expr $n + 1`
done
-./savescreen $PARAMS
+${0%.sh} $PARAMS
if test -f $BEGINS
then
while test -f $BEGINS
do
- ./savescreen -r $PARAMS
+ ${0%.sh} -r $PARAMS
test $? != 0 && break
done
else
diff --git a/test/sp_tinfo.c b/test/sp_tinfo.c
new file mode 100644
index 0000000..419b000
--- /dev/null
+++ b/test/sp_tinfo.c
@@ -0,0 +1,352 @@
+/****************************************************************************
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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: sp_tinfo.c,v 1.23 2020/02/02 23:34:34 tom Exp $
+ *
+ * TOTO: add option for non-sp-funcs interface
+ */
+
+#define USE_TINFO
+#include <test.priv.h>
+
+#if HAVE_TPUTS_SP
+/*
+ * The higher-level curses library stores a TERMINAL* inside SCREEN, but the
+ * latter is opaque. This structure helps us keep the two associated.
+ */
+typedef struct {
+ const char *name;
+ FILE *fp;
+ SCREEN *sp;
+ TERMINAL *term;
+ int (*outc) (SCREEN *, int);
+} MYDATA;
+
+static bool opt_n = FALSE; /* true to suppress new_prescr */
+static bool opt_t = FALSE; /* true to use termcap */
+
+static int
+my_outc(SCREEN *sp, int ch)
+{
+ (void) sp;
+ return fputc(ch, stdout);
+}
+
+static int
+my_errc(SCREEN *sp, int ch)
+{
+ (void) sp;
+ return fputc(ch, stderr);
+}
+
+static MYDATA *
+initialize(const char *name, FILE *output)
+{
+ MYDATA *result = typeCalloc(MYDATA, 1);
+ int error;
+
+ result->fp = output;
+ result->name = name;
+ result->outc = (fileno(output) == 1) ? my_outc : my_errc;
+ result->sp = opt_n ? NULL : new_prescr();
+
+ if (opt_t) {
+ char *temp = strdup(name);
+ tgetent_sp(result->sp, temp, name);
+ free(temp);
+ } else {
+ setupterm((NCURSES_CONST char *) name, fileno(output), &error);
+ }
+ result->term = cur_term;
+
+ return result;
+}
+
+static void
+show_flag(MYDATA * data, const char *name, int value)
+{
+ if (value < 0) {
+ fprintf(data->fp, " %s = (unknown)\n", name);
+ } else if (value == 0) {
+ fprintf(data->fp, " %s = false\n", name);
+ } else {
+ fprintf(data->fp, " %s = true\n", name);
+ }
+}
+
+#define TC_PARMS data->sp, (NCURSES_CONST char *)tc
+#define TI_PARMS data->sp, (NCURSES_CONST char *)ti
+
+static void
+show_cap_flag(MYDATA * data, const char *ti, const char *tc)
+{
+ const char *name = (opt_t ? tc : ti);
+ show_flag(data, name, (opt_t
+ ? tgetflag_sp(TC_PARMS)
+ : tigetflag_sp(TI_PARMS)));
+}
+
+static void
+show_number(MYDATA * data, const char *name, int value)
+{
+ if (value <= -2) {
+ fprintf(data->fp, " %s = (unknown)\n", name);
+ } else if (value <= -1) {
+ fprintf(data->fp, " %s = (missing)\n", name);
+ } else {
+ fprintf(data->fp, " %s = %d\n", name, value);
+ }
+}
+
+static void
+show_cap_number(MYDATA * data, const char *ti, const char *tc)
+{
+ const char *name = (opt_t ? tc : ti);
+ show_number(data, name, (opt_t
+ ? tgetnum_sp(TC_PARMS)
+ : tigetnum_sp(TI_PARMS)));
+}
+
+static void
+show_string(MYDATA * data, const char *name, const char *value)
+{
+ fprintf(data->fp, " %s = ", name);
+ if (value == 0) {
+ fprintf(data->fp, "(missing)");
+ } else if (value == (char *) -1) {
+ fprintf(data->fp, "(canceled)");
+ } else {
+ int ch;
+ while ((ch = UChar(*value++)) != '\0') {
+ if (ch < 32) {
+ fprintf(data->fp, "^%c", ch | '@');
+ } else if (ch == 127) {
+ fprintf(data->fp, "^?");
+ } else if (ch > 127) {
+ fprintf(data->fp, "\\%03o", ch);
+ } else {
+ fprintf(data->fp, "%c", ch);
+ }
+ }
+ }
+ fprintf(data->fp, "\n");
+}
+
+static void
+show_cap_string(MYDATA * data, const char *ti, const char *tc)
+{
+ const char *name = (opt_t ? tc : ti);
+ char tcapjunk[1024];
+ char *tcap_ptr = tcapjunk;
+ show_string(data, name, (opt_t
+ ? tgetstr_sp(TC_PARMS, &tcap_ptr)
+ : tigetstr_sp(TI_PARMS)));
+}
+
+static void
+show_char(MYDATA * data, const char *name, int value)
+{
+ if (value < 0) {
+ show_string(data, name, "(missing)");
+ } else {
+ char temp[2];
+ temp[0] = (char) value;
+ temp[1] = '\0';
+ show_string(data, name, temp);
+ }
+}
+
+static void
+do_stuff(MYDATA * data)
+{
+ SCREEN *sp = data->sp;
+#if NCURSES_EXT_FUNCS
+ char *s;
+ int my_code = 1234;
+ const char *my_text = "\033[?m";
+#endif
+
+ set_curterm_sp(sp, data->term);
+
+ /* putp always goes to standard output */
+ putp_sp(sp, "Hello ");
+ putp_sp(sp, data->name);
+ putp_sp(sp, "!\n");
+
+ fprintf(data->fp, "Term: %s\n", termname_sp(sp));
+ fprintf(data->fp, "Long: %s\n", longname_sp(sp));
+ show_cap_flag(data, "am", "am");
+ show_cap_number(data, "lines", "li");
+ show_cap_string(data, "clear", "cl");
+ show_cap_string(data, "tbc", "ct");
+ show_flag(data, "has_ic", has_ic_sp(sp));
+ show_flag(data, "has_il", has_il_sp(sp));
+ show_number(data, "baudrate", baudrate_sp(sp));
+ show_char(data, "erase ch", erasechar_sp(sp));
+ show_char(data, "kill ch", killchar_sp(sp));
+ show_string(data, "unctrl", unctrl_sp(sp, 033));
+ fflush(data->fp);
+
+#if NCURSES_EXT_FUNCS
+ define_key_sp(sp, my_text, my_code);
+ has_key_sp(sp, 0);
+ key_defined_sp(sp, my_text);
+ if ((s = keybound_sp(sp, my_code, 0)) != 0)
+ free(s);
+#endif
+ keyname_sp(sp, '?');
+#if NCURSES_EXT_FUNCS
+ keyok_sp(sp, my_code, FALSE);
+ keyok_sp(sp, my_code, TRUE);
+#endif
+
+ savetty_sp(sp);
+
+ def_shell_mode_sp(sp);
+
+ /*
+ * These functions are low-level settings for ncurses.
+ */
+#if NCURSES_EXT_FUNCS
+ set_tabsize_sp(sp, 5); /* waddch */
+#endif
+ typeahead_sp(sp, FALSE); /* waddch */
+ use_env_sp(sp, FALSE); /* newterm */
+ use_tioctl_sp(sp, FALSE); /* newterm */
+ intrflush_sp(sp, 0, 0); /* wgetch */
+ flushinp_sp(sp); /* waddch */
+ halfdelay_sp(sp, 5); /* wgetch */
+
+ /*
+ * These manipulate the terminal modes, mainly for wgetch.
+ */
+ cbreak_sp(sp);
+ raw_sp(sp);
+ def_prog_mode_sp(sp);
+
+ delay_output_sp(sp, 200);
+
+ napms_sp(sp, 10);
+
+ nocbreak_sp(sp);
+ noqiflush_sp(sp);
+ noraw_sp(sp);
+ qiflush_sp(sp);
+
+ resetty_sp(sp);
+
+ tputs_sp(sp, "{reset-mode}\n", 0, data->outc);
+
+ reset_prog_mode_sp(sp);
+
+ curs_set_sp(sp, 0);
+ tputs_sp(sp, "{prog-mode}\n", 0, data->outc);
+
+ reset_shell_mode_sp(sp);
+
+ tputs_sp(sp, "{shell-mode}\n", 0, data->outc);
+}
+
+static void
+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);
+}
+
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: sp_tinfo [output] [error]",
+ "",
+ "Options:",
+ " -n suppress call to new_prescr()",
+ " -t use termcap functions rather than terminfo",
+ NULL
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(tbl); ++n) {
+ fprintf(stderr, "%s\n", tbl[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ MYDATA *my_out;
+ MYDATA *my_err;
+ int n;
+
+ while ((n = getopt(argc, argv, "nt")) != -1) {
+ switch (n) {
+ case 'n':
+ opt_n = TRUE;
+ break;
+ case 't':
+ opt_t = TRUE;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ argv += (optind - 1);
+ argc -= (optind - 1);
+
+ if (argc > 3)
+ usage();
+
+ my_out = initialize((argc > 1) ? argv[1] : "vt100", stdout);
+ my_err = initialize((argc > 2) ? argv[2] : "ansi", stderr);
+
+ do_stuff(my_out);
+ do_stuff(my_err);
+
+ cleanup(my_out);
+ cleanup(my_err);
+
+ ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ fprintf(stderr,
+ "This program requires the low-level ncurses sp-funcs tputs_sp\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/tclock.c b/test/tclock.c
index 96e1d19..6460c31 100644
--- a/test/tclock.c
+++ b/test/tclock.c
@@ -1,22 +1,12 @@
-/* $Id: tclock.c,v 1.34 2014/08/02 16:37:03 tom Exp $ */
+/* $Id: tclock.c,v 1.41 2020/01/18 16:46:35 tom Exp $ */
+#define NEED_TIME_H
#include <test.priv.h>
#if HAVE_MATH_H
#include <math.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
/*
tclock - analog/digital clock for curses.
If it gives you joy, then
@@ -58,7 +48,7 @@ plot(int x, int y, int col)
MvAddCh(y, x, (chtype) col);
}
-/* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */
+/* Draw a diagonal(arbitrary) line using Bresenham's algorithm. */
static void
dline(int pair, int from_x, int from_y, int x2, int y2, int ch)
{
@@ -116,8 +106,28 @@ dline(int pair, int from_x, int from_y, int x2, int y2, int ch)
}
}
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: tclock [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
int i, cx, cy;
double cr, mradius, hradius, mangle, hangle;
@@ -137,6 +147,24 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
struct timeval current;
#endif
double fraction = 0.0;
+#if HAVE_USE_DEFAULT_COLORS
+ bool d_option = FALSE;
+#endif
+
+ while ((ch = getopt(argc, argv, "d")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ d_option = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ if (optind < argc)
+ usage();
setlocale(LC_ALL, "");
@@ -149,7 +177,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (has_colors()) {
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (d_option && (use_default_colors() == OK))
my_bg = -1;
#endif
init_pair(1, COLOR_RED, my_bg);
@@ -175,7 +203,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
sangle = (i + 1) * (2.0 * PI) / 12.0;
sdx = A2X(sangle, sradius);
sdy = A2Y(sangle, sradius);
- sprintf(szChar, "%d", i + 1);
+ _nc_SPRINTF(szChar, _nc_SLIMIT(sizeof(szChar)) "%d", i + 1);
MvAddStr(cy - sdy, cx + sdx, szChar);
}
@@ -254,8 +282,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
}
- curs_set(1);
- endwin();
+ stop_curses();
ExitProgram(EXIT_SUCCESS);
}
#else
diff --git a/test/terminal.xbm b/test/terminal.xbm
new file mode 100644
index 0000000..b8d9204
--- /dev/null
+++ b/test/terminal.xbm
@@ -0,0 +1,52 @@
+/*****************************************************************************/
+/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
+/** Salt Lake City, Utah **/
+/** **/
+/** All Rights Reserved **/
+/** **/
+/** Permission to use, copy, modify, and distribute this software and **/
+/** its documentation for any purpose and without fee is hereby **/
+/** granted, provided that the above copyright notice appear in all **/
+/** copies and that both that copyright notice and this permis- **/
+/** sion notice appear in supporting documentation, and that the **/
+/** name of Evans & Sutherland not be used in advertising or publi- **/
+/** city pertaining to distribution of the software without specif- **/
+/** ic, written prior permission. **/
+/** **/
+/** EVANS & SUTHERLAND DISCLAIMS ALL WARRANTIES WITH REGARD TO **/
+/** THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI- **/
+/** TY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND BE LIABLE **/
+/** FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAM- **/
+/** AGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, **/
+/** WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS **/
+/** ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER- **/
+/** FORMANCE OF THIS SOFTWARE. **/
+/*****************************************************************************/
+
+#define xterm_width 48
+#define xterm_height 48
+static char xterm_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x05,
+ 0x20, 0x01, 0x00, 0x00, 0x20, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
+ 0xa0, 0xfc, 0xff, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0xfc, 0x01, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0xfc, 0xff, 0x3f, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0xfc, 0x03, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0xfc, 0xff, 0x01, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0xfc, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x09,
+ 0xa0, 0x00, 0x00, 0x00, 0x40, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x05,
+ 0x20, 0x01, 0x00, 0x00, 0x20, 0x05, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x03,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0xa0, 0xaa, 0xaa, 0xaa, 0x2a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x80, 0x02,
+ 0x50, 0x55, 0x55, 0x55, 0x95, 0x02, 0x08, 0x00, 0x00, 0x00, 0x40, 0x02,
+ 0xa8, 0xaa, 0xaa, 0xaa, 0x4a, 0x02, 0x04, 0x00, 0x00, 0x00, 0x20, 0x01,
+ 0xb4, 0xff, 0xff, 0xff, 0xad, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/test/test.priv.h b/test/test.priv.h
index eedf201..f0b660f 100644
--- a/test/test.priv.h
+++ b/test/test.priv.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2017,2018 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 +30,7 @@
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.131 2014/10/25 01:20:34 tom Exp $ */
+/* $Id: test.priv.h,v 1.185 2020/02/02 23:34:34 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
@@ -58,22 +59,50 @@
/*
* Fallback definitions to accommodate broken compilers.
*/
+#ifndef HAVE_ALLOC_PAIR
+#define HAVE_ALLOC_PAIR 0
+#endif
+
#ifndef HAVE_ASSUME_DEFAULT_COLORS
#define HAVE_ASSUME_DEFAULT_COLORS 0
#endif
+#ifndef HAVE_BSD_STRING_H
+#define HAVE_BSD_STRING_H 0
+#endif
+
#ifndef HAVE_CURSES_VERSION
#define HAVE_CURSES_VERSION 0
#endif
+#ifndef HAVE_CURSCR
+#define HAVE_CURSCR 0
+#endif
+
#ifndef HAVE_CHGAT
#define HAVE_CHGAT 0
#endif
+#ifndef HAVE_COLOR_CONTENT
+#define HAVE_COLOR_CONTENT 0
+#endif
+
+#ifndef HAVE_COPYWIN
+#define HAVE_COPYWIN 0
+#endif
+
#ifndef HAVE_COLOR_SET
#define HAVE_COLOR_SET 0
#endif
+#ifndef HAVE_DELSCREEN
+#define HAVE_DELSCREEN 0
+#endif
+
+#ifndef HAVE_DUPWIN
+#define HAVE_DUPWIN 0
+#endif
+
#ifndef HAVE_FILTER
#define HAVE_FILTER 0
#endif
@@ -106,6 +135,14 @@
#define HAVE_GETWIN 0
#endif
+#ifndef HAVE_HALFDELAY
+#define HAVE_HALFDELAY 0
+#endif
+
+#ifndef HAVE_INIT_EXTENDED_COLOR
+#define HAVE_INIT_EXTENDED_COLOR 0
+#endif
+
#ifndef HAVE_LIBFORM
#define HAVE_LIBFORM 0
#endif
@@ -118,6 +155,10 @@
#define HAVE_LIBPANEL 0
#endif
+#ifndef HAVE_LANGINFO_CODESET
+#define HAVE_LANGINFO_CODESET 0
+#endif
+
#ifndef HAVE_LOCALE_H
#define HAVE_LOCALE_H 0
#endif
@@ -130,10 +171,18 @@
#define HAVE_MENU_H 0
#endif
+#ifndef HAVE_MVDERWIN
+#define HAVE_MVDERWIN 0
+#endif
+
#ifndef HAVE_MVVLINE
#define HAVE_MVVLINE 0
#endif
+#ifndef HAVE_MVWIN
+#define HAVE_MVWIN 0
+#endif
+
#ifndef HAVE_MVWVLINE
#define HAVE_MVWVLINE 0
#endif
@@ -146,6 +195,10 @@
#define HAVE_NC_ALLOC_H 0
#endif
+#ifndef HAVE_NEWPAD
+#define HAVE_NEWPAD 0
+#endif
+
#ifndef HAVE_PANEL_H
#define HAVE_PANEL_H 0
#endif
@@ -154,10 +207,18 @@
#define HAVE_PUTWIN 0
#endif
+#ifndef HAVE_RESET_COLOR_PAIRS
+#define HAVE_RESET_COLOR_PAIRS 0
+#endif
+
#ifndef HAVE_RESIZE_TERM
#define HAVE_RESIZE_TERM 0
#endif
+#ifndef HAVE_RESTARTTERM
+#define HAVE_RESTARTTERM 0
+#endif
+
#ifndef HAVE_RIPOFFLINE
#define HAVE_RIPOFFLINE 0
#endif
@@ -178,6 +239,14 @@
#define HAVE_SLK_INIT 0
#endif
+#ifndef HAVE_STDINT_H
+#define HAVE_STDINT_H 0
+#endif
+
+#ifndef HAVE_STRSTR
+#define HAVE_STRSTR 0
+#endif
+
#ifndef HAVE_SYS_IOCTL_H
#define HAVE_SYS_IOCTL_H 0
#endif
@@ -214,6 +283,14 @@
#define HAVE_TIGETSTR 0
#endif
+#ifndef HAVE_TPUTS_SP
+#define HAVE_TPUTS_SP 0
+#endif
+
+#ifndef HAVE_TSEARCH
+#define HAVE_TSEARCH 0
+#endif
+
#ifndef HAVE_TYPEAHEAD
#define HAVE_TYPEAHEAD 0
#endif
@@ -250,10 +327,18 @@
#define HAVE_VID_PUTS 0
#endif
+#ifndef HAVE_WINSDELLN
+#define HAVE_WINSDELLN 0
+#endif
+
#ifndef HAVE_WRESIZE
#define HAVE_WRESIZE 0
#endif
+#ifndef HAVE__TRACEF
+#define HAVE__TRACEF 0
+#endif
+
#ifndef NCURSES_EXT_FUNCS
#define NCURSES_EXT_FUNCS 0
#endif
@@ -358,6 +443,9 @@ extern int optind;
#ifndef GCC_PRINTFLIKE
#define GCC_PRINTFLIKE(a,b) /* nothing */
#endif
+#ifndef GCC_SCANFLIKE
+#define GCC_SCANFLIKE(a,b) /* nothing */
+#endif
#ifndef GCC_UNUSED
#define GCC_UNUSED /* nothing */
#endif
@@ -366,6 +454,12 @@ extern int optind;
#define getnstr(s,n) getstr(s)
#endif
+#if HAVE_INIT_EXTENDED_COLOR
+#define USE_EXTENDED_COLOR 1
+#else
+#define USE_EXTENDED_COLOR 0
+#endif
+
#ifndef USE_SOFTKEYS
#if HAVE_SLK_INIT
#define USE_SOFTKEYS 1
@@ -380,6 +474,24 @@ extern int optind;
#define slk_clear() /* nothing */
#endif
+#ifndef HAVE_CURSES_DATA_TABSIZE
+#define HAVE_CURSES_DATA_TABSIZE 0
+#endif
+
+#if !NCURSES_EXT_FUNCS
+#if HAVE_CURSES_DATA_TABSIZE
+#define set_tabsize(n) TABSIZE = (n)
+#else
+#define set_tabsize(n) /* nothing */
+#endif
+#endif
+
+#if HAVE_TPUTS_SP
+#define USE_SP_FUNCS 1
+#else
+#define USE_SP_FUNCS 0
+#endif
+
#ifndef HAVE_WSYNCDOWN
#define wsyncdown(win) /* nothing */
#endif
@@ -415,9 +527,9 @@ extern int optind;
/* workaround, to build against NetBSD's variant of the form library */
#ifdef HAVE_NETBSD_FORM_H
-#define form_getyx(form, y, x) y = current_field(form)->cursor_ypos, x = current_field(form)->cursor_xpos
+#define form_getyx(form, y, x) y = (int)current_field(form)->cursor_ypos, x = (int)current_field(form)->cursor_xpos
#else
-#define form_getyx(form, y, x) y = (form)->currow, x = (form)->curcol
+#define form_getyx(form, y, x) y = (int)(form)->currow, x = (int)(form)->curcol
#endif
/* workaround, to build against NetBSD's variant of the form library */
@@ -448,10 +560,6 @@ extern int optind;
#define NCURSES_PAIRS_T short
#endif
-#ifndef NCURSES_OPAQUE
-#define NCURSES_OPAQUE 0
-#endif
-
#ifndef CCHARW_MAX
#define CCHARW_MAX 5
#endif
@@ -495,38 +603,62 @@ extern int optind;
#undef WACS_NEQUAL
#undef WACS_STERLING
-#define WACS_RARROW &(CURSES_WACS_ARRAY['+'])
-#define WACS_LARROW &(CURSES_WACS_ARRAY[','])
-#define WACS_UARROW &(CURSES_WACS_ARRAY['-'])
-#define WACS_DARROW &(CURSES_WACS_ARRAY['.'])
-#define WACS_BLOCK &(CURSES_WACS_ARRAY['0'])
-#define WACS_DIAMOND &(CURSES_WACS_ARRAY['`'])
-#define WACS_CKBOARD &(CURSES_WACS_ARRAY['a'])
-#define WACS_DEGREE &(CURSES_WACS_ARRAY['f'])
-#define WACS_PLMINUS &(CURSES_WACS_ARRAY['g'])
-#define WACS_BOARD &(CURSES_WACS_ARRAY['h'])
-#define WACS_LANTERN &(CURSES_WACS_ARRAY['i'])
-#define WACS_LRCORNER &(CURSES_WACS_ARRAY['j'])
-#define WACS_URCORNER &(CURSES_WACS_ARRAY['k'])
-#define WACS_ULCORNER &(CURSES_WACS_ARRAY['l'])
-#define WACS_LLCORNER &(CURSES_WACS_ARRAY['m'])
-#define WACS_PLUS &(CURSES_WACS_ARRAY['n'])
-#define WACS_HLINE &(CURSES_WACS_ARRAY['q'])
-#define WACS_S1 &(CURSES_WACS_ARRAY['o'])
-#define WACS_S9 &(CURSES_WACS_ARRAY['s'])
-#define WACS_LTEE &(CURSES_WACS_ARRAY['t'])
-#define WACS_RTEE &(CURSES_WACS_ARRAY['u'])
-#define WACS_BTEE &(CURSES_WACS_ARRAY['v'])
-#define WACS_TTEE &(CURSES_WACS_ARRAY['w'])
-#define WACS_VLINE &(CURSES_WACS_ARRAY['x'])
-#define WACS_BULLET &(CURSES_WACS_ARRAY['~'])
-#define WACS_S3 &(CURSES_WACS_ARRAY['p'])
-#define WACS_S7 &(CURSES_WACS_ARRAY['r'])
-#define WACS_LEQUAL &(CURSES_WACS_ARRAY['y'])
-#define WACS_GEQUAL &(CURSES_WACS_ARRAY['z'])
-#define WACS_PI &(CURSES_WACS_ARRAY['{'])
-#define WACS_NEQUAL &(CURSES_WACS_ARRAY['|'])
-#define WACS_STERLING &(CURSES_WACS_ARRAY['}'])
+#define WACS_RARROW &(CURSES_WACS_ARRAY['+'])
+#define WACS_LARROW &(CURSES_WACS_ARRAY[','])
+#define WACS_UARROW &(CURSES_WACS_ARRAY['-'])
+#define WACS_DARROW &(CURSES_WACS_ARRAY['.'])
+#define WACS_BLOCK &(CURSES_WACS_ARRAY['0'])
+#define WACS_DIAMOND &(CURSES_WACS_ARRAY['`'])
+#define WACS_CKBOARD &(CURSES_WACS_ARRAY['a'])
+#define WACS_DEGREE &(CURSES_WACS_ARRAY['f'])
+#define WACS_PLMINUS &(CURSES_WACS_ARRAY['g'])
+#define WACS_BOARD &(CURSES_WACS_ARRAY['h'])
+#define WACS_LANTERN &(CURSES_WACS_ARRAY['i'])
+#define WACS_LRCORNER &(CURSES_WACS_ARRAY['j'])
+#define WACS_URCORNER &(CURSES_WACS_ARRAY['k'])
+#define WACS_ULCORNER &(CURSES_WACS_ARRAY['l'])
+#define WACS_LLCORNER &(CURSES_WACS_ARRAY['m'])
+#define WACS_PLUS &(CURSES_WACS_ARRAY['n'])
+#define WACS_HLINE &(CURSES_WACS_ARRAY['q'])
+#define WACS_S1 &(CURSES_WACS_ARRAY['o'])
+#define WACS_S9 &(CURSES_WACS_ARRAY['s'])
+#define WACS_LTEE &(CURSES_WACS_ARRAY['t'])
+#define WACS_RTEE &(CURSES_WACS_ARRAY['u'])
+#define WACS_BTEE &(CURSES_WACS_ARRAY['v'])
+#define WACS_TTEE &(CURSES_WACS_ARRAY['w'])
+#define WACS_VLINE &(CURSES_WACS_ARRAY['x'])
+#define WACS_BULLET &(CURSES_WACS_ARRAY['~'])
+#define WACS_S3 &(CURSES_WACS_ARRAY['p'])
+#define WACS_S7 &(CURSES_WACS_ARRAY['r'])
+#define WACS_LEQUAL &(CURSES_WACS_ARRAY['y'])
+#define WACS_GEQUAL &(CURSES_WACS_ARRAY['z'])
+#define WACS_PI &(CURSES_WACS_ARRAY['{'])
+#define WACS_NEQUAL &(CURSES_WACS_ARRAY['|'])
+#define WACS_STERLING &(CURSES_WACS_ARRAY['}'])
+#endif
+
+#ifndef WA_NORMAL
+#define WA_NORMAL A_NORMAL
+#endif
+#ifndef WA_BOLD
+#define WA_BOLD A_BOLD
+#endif
+#ifndef WA_REVERSE
+#define WA_REVERSE A_REVERSE
+#endif
+#ifndef WA_UNDERLINE
+#define WA_UNDERLINE A_UNDERLINE
+#endif
+#ifndef WA_BLINK
+#define WA_BLINK A_BLINK
+#endif
+
+#ifndef OK
+#define OK (0)
+#endif
+
+#ifndef ERR
+#define ERR (-1)
#endif
#undef CTRL
@@ -539,12 +671,112 @@ 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>
+#endif
+
+#ifdef __cplusplus
+#define NCURSES_VOID /* nothing */
+#else
+#define NCURSES_VOID (void)
+#endif
+
+#ifndef HAVE_STRLCAT
+#define HAVE_STRLCAT 0
+#endif
+
+#ifndef HAVE_STRLCPY
+#define HAVE_STRLCPY 0
+#endif
+
+#ifndef HAVE_SNPRINTF
+#define HAVE_SNPRINTF 0
+#endif
+
+#ifndef USE_STRING_HACKS
+#define USE_STRING_HACKS 0
+#endif
+
+#ifndef NCURSES_CAST
+#ifdef __cplusplus
+extern "C" {
+#define NCURSES_CAST(type,value) static_cast<type>(value)
+#else
+#define NCURSES_CAST(type,value) (type)(value)
+#endif
+#endif
+
+#if USE_STRING_HACKS && HAVE_STRLCAT
+#define _nc_STRCAT(d,s,n) NCURSES_VOID strlcat((d),(s),NCURSES_CAST(size_t,n))
+#define _nc_STRNCAT(d,s,m,n) NCURSES_VOID strlcat((d),(s),NCURSES_CAST(size_t,m))
+#else
+#define _nc_STRCAT(d,s,n) NCURSES_VOID strcat((d),(s))
+#define _nc_STRNCAT(d,s,m,n) NCURSES_VOID strncat((d),(s),(n))
+#endif
+
+#if USE_STRING_HACKS && HAVE_STRLCPY
+#define _nc_STRCPY(d,s,n) NCURSES_VOID strlcpy((d),(s),NCURSES_CAST(size_t,n))
+#define _nc_STRNCPY(d,s,n) NCURSES_VOID strlcpy((d),(s),NCURSES_CAST(size_t,n))
+#else
+#define _nc_STRCPY(d,s,n) NCURSES_VOID strcpy((d),(s))
+#define _nc_STRNCPY(d,s,n) NCURSES_VOID strncpy((d),(s),(n))
+#endif
+
+#if USE_STRING_HACKS && HAVE_SNPRINTF
+#define _nc_SPRINTF NCURSES_VOID snprintf
+#define _nc_SLIMIT(n) NCURSES_CAST(size_t,n),
+#else
+#define _nc_SPRINTF NCURSES_VOID sprintf
+#define _nc_SLIMIT(n) /* nothing */
+#endif
+
+/*
+ * X/Open Curses does not define the arrays of terminfo/termcap names as SVr4
+ * curses did, and some implementations provide them anyway, but undeclared.
+ */
#ifdef DECL_CURSES_DATA_BOOLNAMES
extern char *boolnames[], *boolcodes[], *boolfnames[];
extern char *numnames[], *numcodes[], *numfnames[];
extern char *strnames[], *strcodes[], *strfnames[];
#endif
+/*
+ * Again, an SVr4 curses feature latent in the libraries but not in headers.
+ */
+#ifndef DECL_CURSES_DATA_TABSIZE
+#define DECL_CURSES_DATA_TABSIZE 0
+#endif
+
+#if DECL_CURSES_DATA_TABSIZE
+extern int TABSIZE;
+#undef HAVE_CURSES_DATA_TABSIZE
+#define HAVE_CURSES_DATA_TABSIZE 1
+#endif
+
+#ifndef HAVE_CURSES_DATA_TABSIZE
+#define HAVE_CURSES_DATA_TABSIZE 0
+#endif
+
+/*
+ * X/Open Curses provides termname(), whose return value is analogous to the
+ * SVr4 curses variable ttytype[].
+ */
+#ifndef HAVE_CURSES_DATA_TTYTYPE
+#define HAVE_CURSES_DATA_TTYTYPE 0
+#endif
+
+#ifndef DECL_CURSES_DATA_TTYTYPE
+#define DECL_CURSES_DATA_TTYTYPE 0
+#endif
+
+#if !defined(ttytype) && (!HAVE_CURSES_DATA_TTYTYPE || DECL_CURSES_DATA_TTYTYPE)
+#define ttytype termname()
+#endif
+
#define colored_chtype(ch, attr, pair) \
((chtype) (ch) | (chtype) (attr) | (chtype) COLOR_PAIR(pair))
@@ -585,18 +817,18 @@ extern char *strnames[], *strcodes[], *strfnames[];
* These usually are implemented as macros, but may be functions.
*/
#if !defined(getcurx) && !HAVE_GETCURX
-#define getcurx(win) ((win)?(win)->_curx:ERR)
-#define getcury(win) ((win)?(win)->_cury:ERR)
+#define getcurx(win) ((win) ? ((int)(win)->_curx) : ERR)
+#define getcury(win) ((win) ? ((int)(win)->_cury) : ERR)
#endif
#if !defined(getbegx) && !HAVE_GETBEGX
-#define getbegx(win) ((win)?(win)->_begx:ERR)
-#define getbegy(win) ((win)?(win)->_begy:ERR)
+#define getbegx(win) ((win) ? ((int)(win)->_begx) : ERR)
+#define getbegy(win) ((win) ? ((int)(win)->_begy) : ERR)
#endif
#if !defined(getmaxx) && !HAVE_GETMAXX
-#define getmaxx(win) ((win)?((win)->_maxx + 1):ERR)
-#define getmaxy(win) ((win)?((win)->_maxy + 1):ERR)
+#define getmaxx(win) ((win) ? ((int)(win)->_maxx + 1) : ERR)
+#define getmaxy(win) ((win) ? ((int)(win)->_maxy + 1) : ERR)
#endif
/*
@@ -650,6 +882,15 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define NCURSES_XNAMES 0
#endif
+/*
+ * ncurses restores the cursor in endwin(). Other libraries may not.
+ */
+#ifdef NCURSES_VERSION
+#define stop_curses() endwin()
+#else
+#define stop_curses() do { endwin(); curs_set(1); } while (0)
+#endif
+
/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list
* (which is incompatible with legacy usage, doesn't solve any problems).
*/
@@ -664,7 +905,7 @@ extern char *strnames[], *strcodes[], *strfnames[];
#include <nc_alloc.h>
#if HAVE_NC_FREEALL && defined(USE_TINFO)
#undef ExitProgram
-#define ExitProgram(code) _nc_free_tinfo(code)
+#define ExitProgram(code) exit_terminfo(code)
#endif
#else
#define typeMalloc(type,n) (type *) malloc((size_t)(n) * sizeof(type))
@@ -683,7 +924,7 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define EXIT_FAILURE 1
#endif
-#if defined(__MINGW32__) || defined(USE_WIN32CON_DRIVER)
+#if defined(_WIN32) || defined(USE_WIN32CON_DRIVER)
#if defined(PDCURSES)
#ifdef WINVER
@@ -715,13 +956,42 @@ extern char *strnames[], *strcodes[], *strfnames[];
#endif
+#ifdef NEED_TIME_H
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#endif
+
+/*
+ * Ultrix 3.1
+ */
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+
+#if !HAVE_STRSTR
+extern char *_nc_strstr(const char *, const char *);
+#define strstr(a,b) _nc_strstr((a),(b))
+#endif /* !HAVE_STRSTR */
+
/* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
* curses which doesn't have const parameters declared (so far) in the places
* that XSI shows.
*/
#ifndef NCURSES_CONST
+#ifdef PDCURSES
+#define NCURSES_CONST const /* close enough */
+#else
#define NCURSES_CONST /* nothing */
#endif
+#endif
/* out-of-band values for representing absent capabilities */
#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */
@@ -739,12 +1009,18 @@ extern char *strnames[], *strcodes[], *strfnames[];
#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~"
-#define CATCHALL(handler) { \
+#define CATCHALL(handler) do { \
int nsig; \
for (nsig = SIGHUP; nsig < SIGTERM; ++nsig) \
if (nsig != SIGKILL) \
signal(nsig, handler); \
- }
+ } while(0)
+
+#ifdef NCURSES_VERSION
+#define InitAndCatch(init,handler) do { CATCHALL(handler); init; } while (0)
+#else
+#define InitAndCatch(init,handler) do { init; CATCHALL(handler); } while (0)
+#endif
/*
* Workaround for clean(er) compile with Solaris's legacy curses.
@@ -799,9 +1075,25 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */
#endif
/*
- * ncurses uses const in some places where X/Open does (or did) not allow.
+ * ncurses provides a termcap interface; a few packagers replace or displace
+ * its header file with an incompatible one. The demo_termcap program uses
+ * the ncurses file, if available.
*/
#ifdef NCURSES_VERSION
+#ifndef HAVE_NCURSES_TERMCAP_H
+#define HAVE_NCURSES_TERMCAP_H 0
+#endif
+#ifndef HAVE_TERMCAP_H
+#define HAVE_TERMCAP_H 0
+#endif
+#endif
+
+/*
+ * ncurses uses const in some places where X/Open does (or did) not allow.
+ */
+#if defined(NCURSES_CONST)
+#define CONST_MENUS NCURSES_CONST
+#elif defined(PDCURSES)
#define CONST_MENUS const
#else
#define CONST_MENUS /* nothing */
@@ -813,10 +1105,12 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */
#if HAVE_USE_WINDOW
#define USING_WINDOW(w,func) use_window(w, (NCURSES_WINDOW_CB) func, w)
+#define USING_WINDOW1(w,func,safe) use_window(w, (NCURSES_WINDOW_CB) safe, NULL)
#define USING_WINDOW2(w,func,data) use_window(w, (NCURSES_WINDOW_CB) func, data)
#define WANT_USE_WINDOW() extern void _nc_want_use_window(void)
#else
-#define USING_WINDOW(w,func) func(w)
+#define USING_WINDOW(w,func) func(w, NULL)
+#define USING_WINDOW1(w,func,safe) func(w)
#define USING_WINDOW2(w,func,data) func(w,data)
#define WANT_USE_WINDOW() extern void _nc_want_use_window(void)
#endif
@@ -829,35 +1123,47 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */
#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void)
#endif
-#ifdef TRACE
+#if defined(TRACE) && HAVE__TRACEF
#define Trace(p) _tracef p
#define USE_TRACE 1
+#define START_TRACE() \
+ if ((_nc_tracing & TRACE_MAXIMUM) == 0) { \
+ int t = _nc_getenv_num("NCURSES_TRACE"); \
+ if (t >= 0) \
+ curses_trace((unsigned) t); \
+ }
+extern unsigned _nc_tracing;
+extern int _nc_getenv_num(const char *);
#else
+#undef TRACE
#define Trace(p) /* nothing */
#define USE_TRACE 0
+#define START_TRACE() /* nothing */
#endif
#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.
*/
#if defined(wattrset) || defined(PDCURSES)
-#define AttrArg(p,a) (attr_t) ((attr_t)(p) | (attr_t)(a))
+#define AttrArg(p,a) (chtype) ((chtype)(p) | (chtype)(a))
#else
-#define AttrArg(p,a) (int) ((attr_t)(p) | (attr_t)(a))
+#define AttrArg(p,a) (int) ((chtype)(p) | (chtype)(a))
#endif
/*
diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c
index c59a339..e2c8b66 100644
--- a/test/test_add_wchstr.c
+++ b/test/test_add_wchstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2010-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_add_wchstr.c,v 1.21 2014/08/02 17:24:55 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.27 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the waddwchstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
@@ -48,18 +49,24 @@
#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 +298,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,14 +313,19 @@ 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];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -351,8 +363,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';
@@ -369,7 +381,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);
@@ -582,8 +594,11 @@ 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);
+#endif
ExitProgram(EXIT_SUCCESS);
}
#else
diff --git a/test/test_addchstr.c b/test/test_addchstr.c
index 2aae844..5b2df8a 100644
--- a/test/test_addchstr.c
+++ b/test/test_addchstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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,16 +27,18 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addchstr.c,v 1.18 2012/12/16 00:36:27 tom Exp $
+ * $Id: test_addchstr.c,v 1.25 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the waddchstr() and waddch functions.
* Thomas Dickey - 2009/9/12
*/
#include <test.priv.h>
-
#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 {
@@ -65,7 +65,7 @@ static bool pass_ctls = FALSE;
static bool w_opt = FALSE;
static int n_opt = -1;
-static attr_t show_attr;
+static chtype show_attr;
static chtype *temp_buffer;
static size_t temp_length;
@@ -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;
@@ -233,7 +233,8 @@ test_adds(int level)
static char cmd[80];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -282,7 +283,7 @@ test_adds(int level)
doupdate();
if (has_colors()) {
- show_attr = (attr_t) COLOR_PAIR(1);
+ show_attr = (chtype) COLOR_PAIR(1);
wbkgdset(work, show_attr | ' ');
} else {
show_attr = A_STANDOUT;
@@ -292,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);
@@ -512,7 +513,10 @@ 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);
+#endif
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/test_addstr.c b/test/test_addstr.c
index a14cded..67e540a 100644
--- a/test/test_addstr.c
+++ b/test/test_addstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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,16 +27,18 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addstr.c,v 1.10 2012/12/16 00:14:10 tom Exp $
+ * $Id: test_addstr.c,v 1.16 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the waddstr() and waddch functions.
* Thomas Dickey - 2009/9/12
*/
#include <test.priv.h>
-
#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;
@@ -155,7 +155,8 @@ test_adds(int level)
static char cmd[80];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -211,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);
@@ -423,7 +424,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (optind < argc)
usage();
- test_adds(0);
+ recursive_test(0);
endwin();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/test_addwstr.c b/test/test_addwstr.c
index ff5a350..22cacb9 100644
--- a/test/test_addwstr.c
+++ b/test/test_addwstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2009-2012,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_addwstr.c,v 1.12 2014/08/02 17:24:55 tom Exp $
+ * $Id: test_addwstr.c,v 1.17 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the waddwstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
@@ -48,12 +49,16 @@
#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 +108,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 +222,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,15 +237,19 @@ 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];
setlocale(LC_ALL, "");
- putenv(strcpy(cmd, "TABSIZE=8"));
+ _nc_STRCPY(cmd, "TABSIZE=8", sizeof(cmd));
+ putenv(cmd);
initscr();
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -249,7 +257,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()) {
@@ -297,7 +305,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);
@@ -367,7 +375,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);
@@ -422,7 +430,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) {
@@ -463,12 +471,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;
@@ -508,7 +516,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (optind < argc)
usage();
- test_inserts(0);
+ recursive_test(0);
endwin();
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/test_arrays.c b/test/test_arrays.c
index e4b9fb1..7ee25ea 100644
--- a/test/test_arrays.c
+++ b/test/test_arrays.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $
+ * $Id: test_arrays.c,v 1.9 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -50,7 +51,14 @@ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
#if HAVE_TIGETSTR
#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
-#define DUMP(name) dump_array(#name, name)
+static bool opt_C;
+static bool opt_T;
+static bool opt_c;
+static bool opt_f;
+static bool opt_n;
+static bool opt_t;
+
+#define PLAIN(opts, name) if (opts) dump_array(#name, name)
static void
dump_array(const char *name, NCURSES_CONST char *const *list)
@@ -63,20 +71,139 @@ dump_array(const char *name, NCURSES_CONST char *const *list)
}
}
+static void
+dump_plain(void)
+{
+ PLAIN(opt_T && opt_n, boolnames);
+ PLAIN(opt_C && opt_c, boolcodes);
+ PLAIN(opt_T && opt_f, boolfnames);
+
+ PLAIN(opt_T && opt_n, numnames);
+ PLAIN(opt_C && opt_c, numcodes);
+ PLAIN(opt_T && opt_f, numfnames);
+
+ PLAIN(opt_T && opt_n, strnames);
+ PLAIN(opt_C && opt_c, strcodes);
+ PLAIN(opt_T && opt_f, strfnames);
+}
+
+#define STRING(opts, name) if (opts) { printf("%s\"%s\"", c++ ? "," : "", name); }
+#define NUMBER(opts, value) if (opts) { printf("%s%d", c++ ? "," : "", value); }
+
+static void
+dump_table(void)
+{
+ int c = 0;
+ int r;
+
+ STRING(opt_t, "Index");
+ STRING(opt_t, "Type");
+ STRING(opt_n, "Name");
+ STRING(opt_c, "Code");
+ STRING(opt_f, "FName");
+ printf("\n");
+
+ for (r = 0; boolnames[r]; ++r) {
+ c = 0;
+ NUMBER(opt_t, r);
+ STRING(opt_t, "bool");
+ STRING(opt_T && opt_n, boolnames[r]);
+ STRING(opt_C && opt_c, boolcodes[r]);
+ STRING(opt_T && opt_f, boolfnames[r]);
+ printf("\n");
+ }
+
+ for (r = 0; numnames[r]; ++r) {
+ c = 0;
+ NUMBER(opt_t, r);
+ STRING(opt_t, "num");
+ STRING(opt_T && opt_n, numnames[r]);
+ STRING(opt_C && opt_c, numcodes[r]);
+ STRING(opt_T && opt_f, numfnames[r]);
+ printf("\n");
+ }
+
+ for (r = 0; strnames[r]; ++r) {
+ c = 0;
+ NUMBER(opt_t, r);
+ STRING(opt_t, "str");
+ STRING(opt_T && opt_n, strnames[r]);
+ STRING(opt_C && opt_c, strcodes[r]);
+ STRING(opt_T && opt_f, strfnames[r]);
+ printf("\n");
+ }
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: test_arrays [options]",
+ "",
+ "If no options are given, print all (boolean, numeric, string)",
+ "capability names showing their index within the tables.",
+ "",
+ "Options:",
+ " -C print termcap names",
+ " -T print terminfo names",
+ " -c print termcap names",
+ " -f print full terminfo names",
+ " -n print short terminfo names",
+ " -t print the result as CSV table",
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
{
- DUMP(boolnames);
- DUMP(boolcodes);
- DUMP(boolfnames);
+ int n;
+
+ while ((n = getopt(argc, argv, "CTcfnt")) != -1) {
+ switch (n) {
+ case 'C':
+ opt_C = TRUE;
+ break;
+ case 'T':
+ opt_T = TRUE;
+ break;
+ case 'c':
+ opt_c = TRUE;
+ break;
+ case 'f':
+ opt_f = TRUE;
+ break;
+ case 'n':
+ opt_n = TRUE;
+ break;
+ case 't':
+ opt_t = TRUE;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ if (optind < argc)
+ usage();
- DUMP(numnames);
- DUMP(numcodes);
- DUMP(numfnames);
+ if (!(opt_T || opt_C)) {
+ opt_T = opt_C = TRUE;
+ }
+ if (!(opt_c || opt_f || opt_n)) {
+ opt_c = opt_f = opt_n = TRUE;
+ }
- DUMP(strnames);
- DUMP(strcodes);
- DUMP(strfnames);
+ if (opt_t) {
+ dump_table();
+ } else {
+ dump_plain();
+ }
ExitProgram(EXIT_SUCCESS);
}
diff --git a/test/test_get_wstr.c b/test/test_get_wstr.c
index dc01b0e..bc86030 100644
--- a/test/test_get_wstr.c
+++ b/test/test_get_wstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2009,2011 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,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.12 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -43,6 +44,7 @@
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if HAVE_CHGAT
/* NetBSD curses wchgat */
@@ -79,14 +81,14 @@ Remainder(WINDOW *txtwin)
static void
ShowPrompt(WINDOW *txtwin, int limit)
{
- wchgat(txtwin, limit, A_REVERSE, 0, NULL);
+ wchgat(txtwin, limit, WA_REVERSE, 0, NULL);
wnoutrefresh(txtwin);
}
static void
MovePrompt(WINDOW *txtwin, int limit, int y, int x)
{
- wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL);
+ wchgat(txtwin, Remainder(txtwin), WA_NORMAL, 0, NULL);
wmove(txtwin, y, x);
ShowPrompt(txtwin, limit);
}
@@ -134,8 +136,30 @@ 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)
{
+ static const char *help[] =
+ {
+ "Commands:",
+ " q,^Q,ESC - quit this program",
+ " ^Q,ESC - quit help-screen",
+ "",
+ " p,<Up> - move beginning of prompt one up row",
+ " j,<Down> - move beginning of prompt one down row",
+ " h,<Left> - move beginning of prompt one left column",
+ " l,<Right> - move beginning of prompt one right column",
+ "",
+ " - - reduce getnstr buffer-size one column",
+ " + - increase getnstr buffer-size one column",
+ " : - prompt for input-text",
+ "",
+ " < - scroll \"left\" through getstr-functions",
+ " > - scroll \"right\" through getstr-functions",
+ "",
+ " w - recur to subwindow",
+ " ?,<F1> - show help-screen",
+ 0
+ };
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
@@ -225,7 +249,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);
@@ -311,10 +335,13 @@ test_get_wstr(int level, char **argv, WINDOW *strwin)
}
noecho();
(void) wattrset(txtwin, A_NORMAL);
- wprintw(strwin, "%d", rc);
+ wprintw(strwin, "%s:", (rc == OK) ? "OK" : "ERR");
(void) waddwstr(strwin, (wchar_t *) buffer);
wnoutrefresh(strwin);
break;
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
default:
beep();
break;
@@ -349,7 +376,7 @@ main(int argc, char *argv[])
strwin = derwin(chrbox, 4, COLS - 2, 1, 1);
- test_get_wstr(1, argv, strwin);
+ recursive_test(1, argv, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/test_getstr.c b/test/test_getstr.c
index 3f64c77..0910a04 100644
--- a/test/test_getstr.c
+++ b/test/test_getstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
+ * $Id: test_getstr.c,v 1.14 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -43,6 +44,7 @@
*/
#include <test.priv.h>
+#include <popup_msg.h>
#if HAVE_CHGAT
/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */
@@ -86,14 +88,14 @@ Remainder(WINDOW *txtwin)
static void
ShowPrompt(WINDOW *txtwin, int limit)
{
- wchgat(txtwin, limit, A_REVERSE, 0, NULL);
+ wchgat(txtwin, limit, WA_REVERSE, 0, NULL);
wnoutrefresh(txtwin);
}
static void
MovePrompt(WINDOW *txtwin, int limit, int y, int x)
{
- wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL);
+ wchgat(txtwin, Remainder(txtwin), WA_NORMAL, 0, NULL);
wmove(txtwin, y, x);
ShowPrompt(txtwin, limit);
}
@@ -141,8 +143,30 @@ 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)
{
+ static const char *help[] =
+ {
+ "Commands:",
+ " q,^Q,ESC - quit this program",
+ " ^Q,ESC - quit help-screen",
+ "",
+ " p,<Up> - move beginning of prompt one up row",
+ " j,<Down> - move beginning of prompt one down row",
+ " h,<Left> - move beginning of prompt one left column",
+ " l,<Right> - move beginning of prompt one right column",
+ "",
+ " - - reduce getnstr buffer-size one column",
+ " + - increase getnstr buffer-size one column",
+ " : - prompt for input-text",
+ "",
+ " < - scroll \"left\" through getstr-functions",
+ " > - scroll \"right\" through getstr-functions",
+ "",
+ " w - recur to subwindow",
+ " ?,<F1> - show help-screen",
+ 0
+ };
WINDOW *txtbox = 0;
WINDOW *txtwin = 0;
FILE *fp;
@@ -233,7 +257,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);
@@ -322,6 +346,9 @@ test_getstr(int level, char **argv, WINDOW *strwin)
wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
wnoutrefresh(strwin);
break;
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
default:
beep();
break;
@@ -356,7 +383,7 @@ main(int argc, char *argv[])
strwin = derwin(chrbox, 4, COLS - 2, 1, 1);
- test_getstr(1, argv, strwin);
+ recursive_test(1, argv, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/test_instr.c b/test/test_instr.c
index 627db08..f04d8a3 100644
--- a/test/test_instr.c
+++ b/test/test_instr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_instr.c,v 1.5 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_instr.c,v 1.10 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -68,7 +69,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;
@@ -85,6 +86,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin)
return FALSE;
}
+ *buffer = '\0';
if (level > 1) {
txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level);
box(txtbox, 0, 0);
@@ -150,7 +152,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);
@@ -253,7 +255,7 @@ main(int argc, char *argv[])
chrwin = derwin(chrbox, 2, COLS - 2, 1, 1);
strwin = derwin(chrbox, 2, COLS - 2, 3, 1);
- test_inchs(1, argv, chrwin, strwin);
+ recursive_test(1, argv, chrwin, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/test_inwstr.c b/test/test_inwstr.c
index 3d2656f..81ebda7 100644
--- a/test/test_inwstr.c
+++ b/test/test_inwstr.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007,2010 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_inwstr.c,v 1.6 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
@@ -70,7 +71,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 +152,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 +255,7 @@ main(int argc, char *argv[])
chrwin = derwin(chrbox, 2, COLS - 2, 1, 1);
strwin = derwin(chrbox, 2, COLS - 2, 3, 1);
- test_inchs(1, argv, chrwin, strwin);
+ recursive_test(1, argv, chrwin, strwin);
endwin();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/test_opaque.c b/test/test_opaque.c
index 6ec75fa..8e19a8c 100644
--- a/test/test_opaque.c
+++ b/test/test_opaque.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2007-2008,2009 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 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_opaque.c,v 1.9 2009/10/24 21:21:29 tom Exp $
+ * $Id: test_opaque.c,v 1.10 2020/02/02 23:34:34 tom Exp $
*
* Author: Thomas E Dickey
*
diff --git a/test/test_setupterm.c b/test/test_setupterm.c
new file mode 100644
index 0000000..9d582aa
--- /dev/null
+++ b/test/test_setupterm.c
@@ -0,0 +1,216 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2015,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 *
+ * "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. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: test_setupterm.c,v 1.10 2020/02/02 23:34:34 tom Exp $
+ *
+ * A simple demo of setupterm/restartterm.
+ */
+#include <test.priv.h>
+
+#if HAVE_TIGETSTR
+
+static bool a_opt = FALSE;
+static bool f_opt = FALSE;
+static bool n_opt = FALSE;
+static bool r_opt = FALSE;
+
+static void
+test_rc(NCURSES_CONST char *name, int actual_rc, int actual_err)
+{
+ int expect_rc = -1;
+ int expect_err = -1;
+
+ if (name == 0)
+ name = getenv("TERM");
+ if (name == 0)
+ name = "?";
+
+ switch (*name) {
+ case 'v': /* vt100 is normal */
+ case 'd': /* dumb has no special flags */
+ expect_rc = 0;
+ expect_err = 1;
+ break;
+ case 'l': /* lpr is hardcopy */
+ expect_err = 1;
+ break;
+ case 'u': /* unknown is generic */
+ expect_err = 0;
+ break;
+ default:
+ break;
+ }
+ if (n_opt) {
+ expect_rc = -1;
+ expect_err = -1;
+ }
+ printf("%s",
+ ((actual_rc == expect_rc && actual_err == expect_err)
+ ? "OK"
+ : "ERR"));
+ printf(" '%s'", name);
+ if (actual_rc == expect_rc) {
+ printf(" rc=%d", actual_rc);
+ } else {
+ printf(" rc=%d (%d)", actual_rc, expect_rc);
+ }
+ if (actual_err == expect_err) {
+ printf(" err=%d", actual_err);
+ } else {
+ printf(" err=%d (%d)", actual_err, expect_err);
+ }
+ printf("\n");
+}
+
+static void
+test_setupterm(NCURSES_CONST char *name)
+{
+ int rc;
+ int err = -99;
+
+#if HAVE_RESTARTTERM
+ if (r_opt)
+ rc = restartterm(name, 0, f_opt ? NULL : &err);
+ else
+#endif
+ rc = setupterm(name, 0, f_opt ? NULL : &err);
+ test_rc(name, rc, err);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: test_setupterm [options] [terminal]",
+ "",
+ "Demonstrate error-checking for setupterm and restartterm.",
+ "",
+ "Options:",
+ " -a automatic test for each success/error code",
+ " -f treat errors as fatal",
+ " -n set environment to disable terminfo database, assuming",
+ " the compiled-in paths for database also fail",
+#if HAVE_RESTARTTERM
+ " -r test restartterm rather than setupterm",
+#endif
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int n;
+
+ while ((n = getopt(argc, argv, "afnr")) != -1) {
+ switch (n) {
+ case 'a':
+ a_opt = TRUE;
+ break;
+ case 'f':
+ f_opt = TRUE;
+ break;
+ case 'n':
+ n_opt = TRUE;
+ break;
+#if HAVE_RESTARTTERM
+ case 'r':
+ r_opt = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ break;
+ }
+ }
+
+ if (n_opt) {
+ static char none[][25] =
+ {
+ "HOME=/GUI",
+ "TERMINFO=/GUI",
+ "TERMINFO_DIRS=/GUI"
+ };
+ /*
+ * We can turn this off, but not on again, because ncurses caches the
+ * directory locations.
+ */
+ printf("** without database\n");
+ for (n = 0; n < 3; ++n)
+ putenv(none[n]);
+ } else {
+ printf("** with database\n");
+ }
+
+ /*
+ * The restartterm relies on an existing screen, so we make one here.
+ */
+ if (r_opt) {
+ newterm("ansi", stdout, stdin);
+ reset_shell_mode();
+ }
+
+ if (a_opt) {
+ static char predef[][9] =
+ {"vt100", "dumb", "lpr", "unknown", "none-such"};
+ if (optind < argc) {
+ usage();
+ }
+ for (n = 0; n < 4; ++n) {
+ test_setupterm(predef[n]);
+ }
+ } else {
+ if (optind < argc) {
+ for (n = optind; n < argc; ++n) {
+ test_setupterm(argv[n]);
+ }
+ } else {
+ test_setupterm(NULL);
+ }
+ }
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("This program requires the terminfo functions such as tigetstr\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */
diff --git a/test/test_sgr.c b/test/test_sgr.c
new file mode 100644
index 0000000..aeb833c
--- /dev/null
+++ b/test/test_sgr.c
@@ -0,0 +1,384 @@
+/****************************************************************************
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2015-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"), 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. *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: test_sgr.c,v 1.15 2020/02/02 23:34:34 tom Exp $
+ *
+ * A simple demo of the sgr/sgr0 terminal capabilities.
+ */
+#define USE_TINFO
+#include <test.priv.h>
+
+#if !HAVE_TIGETSTR
+static void failed(const char *) GCC_NORETURN;
+
+static void
+failed(const char *msg)
+{
+ fprintf(stderr, "%s\n", msg);
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
+
+#if HAVE_TIGETSTR
+
+static bool no_init = FALSE;
+static bool q_opt = FALSE;
+
+static char *d_opt;
+static char *e_opt;
+static char **db_list;
+static int db_item;
+
+static long total_values;
+
+static char *
+make_dbitem(char *p, char *q)
+{
+ size_t need = strlen(e_opt) + 2 + (size_t) (p - q);
+ char *result = malloc(need);
+ _nc_SPRINTF(result, _nc_SLIMIT(need) "%s=%.*s", e_opt, (int) (p - q), q);
+ return result;
+}
+
+static void
+make_dblist(void)
+{
+ if (d_opt && e_opt) {
+ int pass;
+
+ for (pass = 0; pass < 2; ++pass) {
+ char *p, *q;
+ size_t count = 0;
+
+ for (p = q = d_opt; *p != '\0'; ++p) {
+ if (*p == ':') {
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ q = p + 1;
+ }
+ }
+ if (p != q + 1) {
+ if (pass) {
+ db_list[count] = make_dbitem(p, q);
+ }
+ count++;
+ }
+ if (!pass) {
+ db_list = typeCalloc(char *, count + 1);
+ }
+ }
+ }
+}
+
+static char *
+next_dbitem(void)
+{
+ char *result = 0;
+
+ if (db_list) {
+ if ((result = db_list[db_item]) == 0) {
+ db_item = 0;
+ result = db_list[0];
+ } else {
+ db_item++;
+ }
+ }
+ printf("** %s\n", result);
+ return result;
+}
+
+#if NO_LEAKS
+static void
+free_dblist(void)
+{
+ if (db_list) {
+ int n;
+ for (n = 0; db_list[n]; ++n)
+ free(db_list[n]);
+ free(db_list);
+ db_list = 0;
+ }
+}
+#endif
+
+#define MAXPAR 9
+#define MAXSGR (1 << MAXPAR)
+#define BITS2P(n) (count & (1 << (n - 1)))
+#define MASK_SMSO (1 << 0)
+#define MASK_BOLD (1 << 5)
+#define MASK_REV (1 << 2)
+
+static void
+dumpit(unsigned bits, unsigned ignore, const char *sgr, const char *sgr0)
+{
+ static const char sample[] = "abcdefghijklm";
+ static char params[] = "SURBDBIPA";
+ unsigned n;
+
+ printf("%4u ", bits);
+ bits &= ~ignore;
+ for (n = 0; n < MAXPAR; ++n) {
+ putchar((int) ((bits & (unsigned) (1 << n)) ? params[n] : '-'));
+ }
+ putchar(' ');
+ putp(sgr);
+ putp(sample);
+ putp(sgr0);
+ putchar('\n');
+}
+
+static bool
+one_bit(unsigned a, unsigned b)
+{
+ unsigned c = (a ^ b);
+ bool result = FALSE;
+ if (c) {
+ while (!(c & 1)) {
+ c >>= 1;
+ }
+ result = (c == 1);
+ }
+ return result;
+}
+
+static void
+brute_force(const char *name)
+{
+ unsigned count;
+ char *my_sgr;
+ char *my_sgr0;
+ char *my_bold;
+ char *my_revs;
+ char *my_smso;
+ char *my_name = strdup(name);
+
+ if (db_list) {
+ putenv(next_dbitem());
+ }
+
+ if (!q_opt)
+ printf("Terminal type \"%s\"\n", my_name);
+
+ if (no_init) {
+ START_TRACE();
+ } else {
+ setupterm((NCURSES_CONST char *) my_name, 1, (int *) 0);
+ }
+
+ if (!q_opt) {
+ if (strcmp(my_name, ttytype))
+ printf("... actual \"%s\"\n", ttytype);
+ }
+
+ my_sgr = tigetstr("sgr");
+ my_sgr0 = tigetstr("sgr0");
+ my_bold = tigetstr("bold");
+ my_revs = tigetstr("rev");
+ my_smso = tigetstr("smso");
+
+ if (!VALID_STRING(my_sgr)) {
+ fprintf(stderr, "no \"sgr\" capability found\n");
+ } else if (!VALID_STRING(my_sgr0)) {
+ fprintf(stderr, "no \"sgr0\" capability found\n");
+ } else {
+ char *values[MAXSGR + MAXPAR];
+ unsigned j;
+ unsigned ignore = 0;
+ unsigned reason = 0;
+ unsigned repeat = 0;
+ for (count = 0; count < MAXSGR; ++count) {
+ values[count] = tparm(my_sgr,
+ BITS2P(1),
+ BITS2P(2),
+ BITS2P(3),
+ BITS2P(4),
+ BITS2P(5),
+ BITS2P(6),
+ BITS2P(7),
+ BITS2P(8),
+ BITS2P(9));
+ if (values[count] != 0) {
+ values[count] = strdup(values[count]);
+ }
+ }
+ for (count = 0; count < MAXSGR; ++count) {
+ if (values[count] != 0) {
+ for (j = count + 1; j < MAXSGR; ++j) {
+ if (values[j] == 0)
+ continue;
+ if (strcmp(values[count], values[j]))
+ continue;
+ if (one_bit(count, j)) {
+ free(values[j]);
+ values[j] = 0;
+ }
+ }
+ }
+ }
+ for (j = 0; j < MAXPAR; ++j) {
+ unsigned mask = (unsigned) (1 << j);
+ for (count = 0; count < MAXSGR; ++count) {
+ if ((count & mask) != 0)
+ continue;
+ if (values[count] != 0 && values[count + mask] != 0) {
+ mask = 0;
+ break;
+ }
+ }
+ ignore |= mask;
+ }
+ /* smso is tested first, but often duplicates bold or reverse. */
+ if (VALID_STRING(my_smso)) {
+ if (VALID_STRING(my_bold) && !strcmp(my_bold, my_smso)) {
+ repeat |= MASK_SMSO;
+ reason = MASK_BOLD;
+ }
+ if (VALID_STRING(my_revs) && !strcmp(my_revs, my_smso)) {
+ repeat |= MASK_SMSO;
+ reason = MASK_REV;
+ }
+ }
+ for (count = 0; count < MAXSGR; ++count) {
+ if (values[count] != 0) {
+ bool found = FALSE;
+ if ((repeat & MASK_SMSO) != 0
+ && (count & MASK_SMSO) != 0) {
+ found = TRUE;
+ } else {
+ for (j = 0; j < count; ++j) {
+ if (values[j] != 0 && !strcmp(values[j], values[count])) {
+ if ((repeat & MASK_SMSO) != 0
+ && (j & MASK_SMSO) != 0
+ && (count & reason) != 0) {
+ continue;
+ }
+ found = TRUE;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ dumpit(count, ignore, values[count], my_sgr0);
+ ++total_values;
+ }
+ }
+ }
+ for (count = 0; count < MAXSGR; ++count) {
+ free(values[count]);
+ }
+ }
+ free(my_name);
+ del_curterm(cur_term);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: test_sgr [options] [terminal]",
+ "",
+ "Print all distinct combinations of sgr capability.",
+ "",
+ "Options:",
+ " -d LIST colon-separated list of databases to use",
+ " -e NAME environment variable to set with -d option",
+ " -n do not initialize terminal, to test error-checking",
+ " -q quiet (prints only counts)",
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(msg); ++n) {
+ fprintf(stderr, "%s\n", msg[n]);
+ }
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int n;
+ char *name;
+
+ while ((n = getopt(argc, argv, "d:e:nq")) != -1) {
+ switch (n) {
+ case 'd':
+ d_opt = optarg;
+ break;
+ case 'e':
+ e_opt = optarg;
+ break;
+ case 'n':
+ no_init = TRUE;
+ break;
+ case 'q':
+ q_opt = TRUE;
+ break;
+ default:
+ usage();
+ break;
+ }
+ }
+
+ make_dblist();
+
+ if (optind < argc) {
+ for (n = optind; n < argc; ++n) {
+ brute_force(argv[n]);
+ }
+ } else if ((name = getenv("TERM")) != 0) {
+ brute_force(name);
+ } else {
+ static char dumb[] = "dumb";
+ brute_force(dumb);
+ }
+
+ printf("%ld distinct values\n", total_values);
+
+#if NO_LEAKS
+ free_dblist();
+#endif
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ failed("This program requires the terminfo functions such as tigetstr");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */
diff --git a/test/test_termattrs.c b/test/test_termattrs.c
new file mode 100644
index 0000000..fc22216
--- /dev/null
+++ b/test/test_termattrs.c
@@ -0,0 +1,200 @@
+/****************************************************************************
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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: test_termattrs.c,v 1.3 2020/02/02 23:34:34 tom Exp $
+ *
+ * Demonstrate the termattrs and term_attrs functions.
+ */
+
+#define USE_TINFO
+#include <test.priv.h>
+
+#if HAVE_SETUPTERM
+
+static FILE *my_fp;
+
+static void
+test_termattrs(unsigned long value)
+{
+#define DATA(name) { name, #name }
+ static struct {
+ unsigned long code;
+ const char *name;
+ } table[] = {
+#ifdef A_ATTRIBUTES
+ DATA(A_ATTRIBUTES),
+#endif
+#ifdef A_CHARTEXT
+ DATA(A_CHARTEXT),
+#endif
+#ifdef A_COLOR
+ DATA(A_COLOR),
+#endif
+#ifdef A_STANDOUT
+ DATA(A_STANDOUT),
+#endif
+#ifdef A_UNDERLINE
+ DATA(A_UNDERLINE),
+#endif
+#ifdef A_REVERSE
+ DATA(A_REVERSE),
+#endif
+#ifdef A_BLINK
+ DATA(A_BLINK),
+#endif
+#ifdef A_DIM
+ DATA(A_DIM),
+#endif
+#ifdef A_BOLD
+ DATA(A_BOLD),
+#endif
+#ifdef A_ALTCHARSET
+ DATA(A_ALTCHARSET),
+#endif
+#ifdef A_INVIS
+ DATA(A_INVIS),
+#endif
+#ifdef A_PROTECT
+ DATA(A_PROTECT),
+#endif
+#ifdef A_HORIZONTAL
+ DATA(A_HORIZONTAL),
+#endif
+#ifdef A_LEFT
+ DATA(A_LEFT),
+#endif
+#ifdef A_LOW
+ DATA(A_LOW),
+#endif
+#ifdef A_RIGHT
+ DATA(A_RIGHT),
+#endif
+#ifdef A_TOP
+ DATA(A_TOP),
+#endif
+#ifdef A_VERTICAL
+ DATA(A_VERTICAL),
+#endif
+#ifdef A_ITALIC
+ DATA(A_ITALIC),
+#endif
+ };
+ size_t n;
+ fprintf(my_fp, "Result: %08lX\r\n", value);
+ for (n = 0; n < SIZEOF(table); ++n) {
+ if ((value & table[n].code) != 0) {
+ fprintf(my_fp, "%08lX %08lX %s\r\n",
+ table[n].code, value & table[n].code, table[n].name);
+ }
+ };
+ fputs("\r\n", my_fp);
+}
+
+static void
+usage(void)
+{
+ static const char *tbl[] =
+ {
+ "Usage: test_termattrs [options]"
+ ,""
+ ,"Options:"
+ ," -e use stderr (default stdout)"
+ ," -n do not initialize terminal"
+ ," -s use setupterm rather than newterm"
+#if USE_WIDEC_SUPPORT
+ ," -w use term_attrs rather than termattrs"
+#endif
+ };
+ unsigned n;
+ for (n = 0; n < SIZEOF(tbl); ++n)
+ fprintf(stderr, "%s\n", tbl[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int ch;
+ bool no_init = FALSE;
+ bool s_opt = FALSE;
+#if USE_WIDEC_SUPPORT
+ bool w_opt = FALSE;
+#endif
+
+ my_fp = stdout;
+
+ while ((ch = getopt(argc, argv, "ensw")) != -1) {
+ switch (ch) {
+ case 'e':
+ my_fp = stderr;
+ break;
+ case 'n':
+ no_init = TRUE;
+ break;
+ case 's':
+ s_opt = TRUE;
+ break;
+#if USE_WIDEC_SUPPORT
+ case 'w':
+ w_opt = TRUE;
+ break;
+#endif
+ default:
+ usage();
+ break;
+ }
+ }
+ if (optind < argc)
+ usage();
+
+ if (no_init) {
+ START_TRACE();
+ } else if (s_opt) {
+ setupterm((char *) 0, fileno(my_fp), (int *) 0);
+ } else {
+ newterm((char *) 0, my_fp, stdin);
+ }
+#if USE_WIDEC_SUPPORT
+ if (w_opt)
+ test_termattrs((unsigned long) term_attrs());
+ else
+#endif
+ test_termattrs((unsigned long) termattrs());
+ ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ fprintf(stderr, "This program requires terminfo\n");
+ exit(EXIT_FAILURE);
+}
+#endif
diff --git a/test/test_vid_puts.c b/test/test_vid_puts.c
index 9896d1b..85a7f4e 100644
--- a/test/test_vid_puts.c
+++ b/test/test_vid_puts.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -26,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_vid_puts.c,v 1.6 2014/07/19 23:09:28 tom Exp $
+ * $Id: test_vid_puts.c,v 1.11 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the vid_puts and vid_attr functions.
* Thomas Dickey - 2013/01/12
@@ -37,8 +38,6 @@
#if USE_WIDEC_SUPPORT && HAVE_SETUPTERM && HAVE_VID_PUTS
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static FILE *my_fp;
static bool p_opt = FALSE;
@@ -54,7 +53,7 @@ TPUTS_PROTO(outc, c)
static bool
outs(const char *s)
{
- if (valid(s)) {
+ if (VALID_STRING(s)) {
tputs(s, 1, outc);
return TRUE;
}
@@ -64,10 +63,12 @@ outs(const char *s)
static void
cleanup(void)
{
- outs(exit_attribute_mode);
- if (!outs(orig_colors))
- outs(orig_pair);
- outs(cursor_normal);
+ if (cur_term != 0) {
+ outs(exit_attribute_mode);
+ if (!outs(orig_colors))
+ outs(orig_pair);
+ outs(cursor_normal);
+ }
}
static void
@@ -101,6 +102,7 @@ usage(void)
,""
,"Options:"
," -e use stderr (default stdout)"
+ ," -n do not initialize terminal"
," -p use vid_puts (default vid_attr)"
};
unsigned n;
@@ -113,14 +115,18 @@ int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
int ch;
+ bool no_init = FALSE;
my_fp = stdout;
- while ((ch = getopt(argc, argv, "ep")) != -1) {
+ while ((ch = getopt(argc, argv, "enp")) != -1) {
switch (ch) {
case 'e':
my_fp = stderr;
break;
+ case 'n':
+ no_init = TRUE;
+ break;
case 'p':
p_opt = TRUE;
break;
@@ -132,7 +138,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (optind < argc)
usage();
- setupterm((char *) 0, 1, (int *) 0);
+ if (no_init) {
+ START_TRACE();
+ } else {
+ setupterm((char *) 0, fileno(my_fp), (int *) 0);
+ }
test_vid_puts();
cleanup();
ExitProgram(EXIT_SUCCESS);
diff --git a/test/test_vidputs.c b/test/test_vidputs.c
index 7c7ade3..355f100 100644
--- a/test/test_vidputs.c
+++ b/test/test_vidputs.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 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 *
@@ -26,7 +27,7 @@
* authorization. *
****************************************************************************/
/*
- * $Id: test_vidputs.c,v 1.5 2014/07/19 23:09:58 tom Exp $
+ * $Id: test_vidputs.c,v 1.10 2020/02/02 23:34:34 tom Exp $
*
* Demonstrate the vidputs and vidattr functions.
* Thomas Dickey - 2013/01/12
@@ -37,8 +38,6 @@
#if HAVE_SETUPTERM && HAVE_VIDPUTS
-#define valid(s) ((s != 0) && s != (char *)-1)
-
static FILE *my_fp;
static bool p_opt = FALSE;
@@ -54,7 +53,7 @@ TPUTS_PROTO(outc, c)
static bool
outs(const char *s)
{
- if (valid(s)) {
+ if (VALID_STRING(s)) {
tputs(s, 1, outc);
return TRUE;
}
@@ -64,10 +63,12 @@ outs(const char *s)
static void
cleanup(void)
{
- outs(exit_attribute_mode);
- if (!outs(orig_colors))
- outs(orig_pair);
- outs(cursor_normal);
+ if (cur_term != 0) {
+ outs(exit_attribute_mode);
+ if (!outs(orig_colors))
+ outs(orig_pair);
+ outs(cursor_normal);
+ }
}
static void
@@ -101,6 +102,7 @@ usage(void)
,""
,"Options:"
," -e use stderr (default stdout)"
+ ," -n do not initialize terminal"
," -p use vidputs (default vidattr)"
};
unsigned n;
@@ -113,14 +115,18 @@ int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
int ch;
+ bool no_init = FALSE;
my_fp = stdout;
- while ((ch = getopt(argc, argv, "ep")) != -1) {
+ while ((ch = getopt(argc, argv, "enp")) != -1) {
switch (ch) {
case 'e':
my_fp = stderr;
break;
+ case 'n':
+ no_init = TRUE;
+ break;
case 'p':
p_opt = TRUE;
break;
@@ -132,11 +138,16 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
if (optind < argc)
usage();
- setupterm((char *) 0, 1, (int *) 0);
+ if (no_init) {
+ START_TRACE();
+ } else {
+ setupterm((char *) 0, fileno(my_fp), (int *) 0);
+ }
test_vidputs();
cleanup();
ExitProgram(EXIT_SUCCESS);
}
+
#else
int
main(int argc GCC_UNUSED,
diff --git a/test/testaddch.c b/test/testaddch.c
index ccadab8..875c8be 100644
--- a/test/testaddch.c
+++ b/test/testaddch.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 Thomas E. Dickey *
+ * Copyright 1998-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 +30,7 @@
* This is an example written by Alexander V. Lukyanov <lav@yars.free.net>,
* to demonstrate an inconsistency between ncurses and SVr4 curses.
*
- * $Id: testaddch.c,v 1.12 2014/08/02 23:11:20 tom Exp $
+ * $Id: testaddch.c,v 1.13 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
diff --git a/test/testcurs.c b/test/testcurs.c
index a1f0057..f9762b0 100644
--- a/test/testcurs.c
+++ b/test/testcurs.c
@@ -6,13 +6,13 @@
* wrs(5/28/93) -- modified to be consistent (perform identically) with either
* PDCurses or under Unix System V, R4
*
- * $Id: testcurs.c,v 1.49 2014/07/27 00:25:14 tom Exp $
+ * $Id: testcurs.c,v 1.55 2019/12/14 23:25:29 tom Exp $
*/
#include <test.priv.h>
#if defined(XCURSES)
-char *XCursesProgramName = "testcurs";
+const char *XCursesProgramName = "testcurs";
#endif
static int initTest(WINDOW **);
@@ -20,127 +20,16 @@ static void display_menu(int, int);
static void inputTest(WINDOW *);
static void introTest(WINDOW *);
static void outputTest(WINDOW *);
+#if HAVE_NEWPAD
static void padTest(WINDOW *);
+#endif
static void scrollTest(WINDOW *);
#if defined(PDCURSES) && !defined(XCURSES)
static void resizeTest(WINDOW *);
#endif
-struct commands {
- NCURSES_CONST char *text;
- void (*function) (WINDOW *);
-};
-typedef struct commands COMMAND;
-
-static const COMMAND command[] =
-{
- {"General Test", introTest},
- {"Pad Test", padTest},
-#if defined(PDCURSES) && !defined(XCURSES)
- {"Resize Test", resizeTest},
-#endif
- {"Scroll Test", scrollTest},
- {"Input Test", inputTest},
- {"Output Test", outputTest}
-};
-#define MAX_OPTIONS (int) SIZEOF(command)
-
static int width, height;
-int
-main(
- int argc GCC_UNUSED,
- char *argv[]GCC_UNUSED)
-{
- WINDOW *win;
- int key;
- int old_option = (-1);
- int new_option = 0;
- bool quit = FALSE;
- int n;
-
- setlocale(LC_ALL, "");
-
-#ifdef PDCDEBUG
- PDC_debug("testcurs started\n");
-#endif
- if (!initTest(&win))
- ExitProgram(EXIT_FAILURE);
-
- erase();
- display_menu(old_option, new_option);
- for (;;) {
-#ifdef A_COLOR
- if (has_colors()) {
- init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgd(win, (chtype) COLOR_PAIR(1));
- } else
- wbkgd(win, A_REVERSE);
-#else
- wbkgd(win, A_REVERSE);
-#endif
- werase(win);
-
- noecho();
- keypad(stdscr, TRUE);
- raw();
- key = getch();
- if (key < KEY_MIN && key > 0 && isalpha(key)) {
- if (islower(key))
- key = toupper(key);
- for (n = 0; n < MAX_OPTIONS; ++n) {
- if (key == command[n].text[0]) {
- display_menu(old_option, new_option = n);
- key = ' ';
- break;
- }
- }
- }
- switch (key) {
- case 10:
- case 13:
- case KEY_ENTER:
- erase();
- refresh();
- (*command[new_option].function) (win);
- erase();
- display_menu(old_option, new_option);
- break;
- case KEY_UP:
- new_option = ((new_option == 0)
- ? new_option
- : new_option - 1);
- display_menu(old_option, new_option);
- break;
- case KEY_DOWN:
- new_option = ((new_option == (MAX_OPTIONS - 1))
- ? new_option
- : new_option + 1);
- display_menu(old_option, new_option);
- break;
- case 'Q':
- case 'q':
- quit = TRUE;
- break;
- default:
- beep();
- break;
- case ' ':
- break;
- }
- if (quit == TRUE)
- break;
- }
-
- delwin(win);
-
- endwin();
-#ifdef XCURSES
- XCursesExit();
-#endif
- ExitProgram(EXIT_SUCCESS);
-}
-
static void
Continue(WINDOW *win)
{
@@ -170,7 +59,7 @@ initTest(WINDOW **win)
PDC_debug("initTest called\n");
#endif
#ifdef TRACE
- trace(TRACE_MAXIMUM);
+ curses_trace(TRACE_MAXIMUM);
#endif
initscr();
#ifdef PDCDEBUG
@@ -184,7 +73,7 @@ initTest(WINDOW **win)
height = 13; /* Create a drawing window */
*win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
if (*win == NULL) {
- endwin();
+ stop_curses();
return 0;
}
return 1;
@@ -437,7 +326,7 @@ inputTest(WINDOW *win)
"%d %[][a-zA-Z]s",
"%d %[^0-9]"
};
- const char *format = fmt[(unsigned) repeat % SIZEOF(fmt)];
+ char *format = strdup(fmt[(unsigned) repeat % SIZEOF(fmt)]);
wclear(win);
MvWAddStr(win, 3, 2, "The window should have moved");
@@ -453,12 +342,13 @@ inputTest(WINDOW *win)
noraw();
num = 0;
*buffer = 0;
- answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer);
+ answered = mvwscanw(win, 7, 6, format, &num, buffer);
MvWPrintw(win, 8, 6,
"String: %s Number: %d (%d values read)",
buffer, num, answered);
Continue(win);
++repeat;
+ free(format);
} while (answered > 0);
}
@@ -667,7 +557,7 @@ resizeTest(WINDOW *dummy GCC_UNUSED)
win1 = newwin(10, 50, 14, 25);
if (win1 == NULL) {
- endwin();
+ stop_curses();
return;
}
#ifdef A_COLOR
@@ -695,6 +585,7 @@ resizeTest(WINDOW *dummy GCC_UNUSED)
}
#endif
+#if HAVE_NEWPAD
static void
padTest(WINDOW *dummy GCC_UNUSED)
{
@@ -735,6 +626,28 @@ padTest(WINDOW *dummy GCC_UNUSED)
delwin(pad);
}
}
+#endif /* HAVE_NEWPAD */
+
+struct commands {
+ NCURSES_CONST char *text;
+ void (*function) (WINDOW *);
+};
+typedef struct commands COMMAND;
+
+static const COMMAND command[] =
+{
+ {"General Test", introTest},
+#if HAVE_NEWPAD
+ {"Pad Test", padTest},
+#endif
+#if defined(PDCURSES) && !defined(XCURSES)
+ {"Resize Test", resizeTest},
+#endif
+ {"Scroll Test", scrollTest},
+ {"Input Test", inputTest},
+ {"Output Test", outputTest}
+};
+#define MAX_OPTIONS (int) SIZEOF(command)
static void
display_menu(int old_option, int new_option)
@@ -759,3 +672,97 @@ display_menu(int old_option, int new_option)
"Use Up and Down Arrows to select - Enter to run - Q to quit");
refresh();
}
+
+int
+main(
+ int argc GCC_UNUSED,
+ char *argv[]GCC_UNUSED)
+{
+ WINDOW *win;
+ int key;
+ int old_option = (-1);
+ int new_option = 0;
+ bool quit = FALSE;
+ int n;
+
+ setlocale(LC_ALL, "");
+
+#ifdef PDCDEBUG
+ PDC_debug("testcurs started\n");
+#endif
+ if (!initTest(&win))
+ ExitProgram(EXIT_FAILURE);
+
+ erase();
+ display_menu(old_option, new_option);
+ for (;;) {
+#ifdef A_COLOR
+ if (has_colors()) {
+ init_pair(1, COLOR_WHITE, COLOR_BLUE);
+ wbkgd(win, (chtype) COLOR_PAIR(1));
+ } else
+ wbkgd(win, A_REVERSE);
+#else
+ wbkgd(win, A_REVERSE);
+#endif
+ werase(win);
+
+ noecho();
+ keypad(stdscr, TRUE);
+ raw();
+ key = getch();
+ if (key < KEY_MIN && key > 0 && isalpha(key)) {
+ if (islower(key))
+ key = toupper(key);
+ for (n = 0; n < MAX_OPTIONS; ++n) {
+ if (key == command[n].text[0]) {
+ display_menu(old_option, new_option = n);
+ key = ' ';
+ break;
+ }
+ }
+ }
+ switch (key) {
+ case 10:
+ case 13:
+ case KEY_ENTER:
+ erase();
+ refresh();
+ (*command[new_option].function) (win);
+ erase();
+ display_menu(old_option, new_option);
+ break;
+ case KEY_UP:
+ new_option = ((new_option == 0)
+ ? new_option
+ : new_option - 1);
+ display_menu(old_option, new_option);
+ break;
+ case KEY_DOWN:
+ new_option = ((new_option == (MAX_OPTIONS - 1))
+ ? new_option
+ : new_option + 1);
+ display_menu(old_option, new_option);
+ break;
+ case 'Q':
+ case 'q':
+ quit = TRUE;
+ break;
+ default:
+ beep();
+ break;
+ case ' ':
+ break;
+ }
+ if (quit == TRUE)
+ break;
+ }
+
+ delwin(win);
+
+ stop_curses();
+#ifdef XCURSES
+ XCursesExit();
+#endif
+ ExitProgram(EXIT_SUCCESS);
+}
diff --git a/test/testscanw.c b/test/testscanw.c
index 79589c2..251c464 100644
--- a/test/testscanw.c
+++ b/test/testscanw.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2002,2006 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 +30,7 @@
* Date: 1997/03/17
* From: bayern@morpheus.cis.yale.edu
*
- * $Id: testscanw.c,v 1.11 2006/04/01 19:08:03 tom Exp $
+ * $Id: testscanw.c,v 1.13 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
@@ -47,7 +48,7 @@ main(int argc, char *argv[])
echo();
#if 0
- trace(TRACE_UPDATE | TRACE_CALLS);
+ curses_trace(TRACE_UPDATE | TRACE_CALLS);
#endif
while (argc > 1) {
if (isdigit(UChar(*argv[1])))
diff --git a/test/tput-colorcube b/test/tput-colorcube
new file mode 100755
index 0000000..67a4997
--- /dev/null
+++ b/test/tput-colorcube
@@ -0,0 +1,131 @@
+#!/bin/sh
+##############################################################################
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 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 "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: tput-colorcube,v 1.2 2020/02/02 23:34:34 tom Exp $
+# Use this script to print an xterm-style color cube, e.g., as done in
+# the xterm 88colors2.pl and 256colors2.pl scripts.
+
+failed() {
+ printf "?? $*\n" >&2
+ exit 1
+}
+
+newline() {
+ tput op
+ printf "\n"
+}
+
+if [ $# = 1 ]
+then
+ myterm=$1
+elif [ $# = 0 ]
+then
+ myterm=$TERM
+else
+ failed "expected one parameter or none"
+fi
+
+colors=$(tput -T $myterm colors 2>/dev/null)
+if [ ${colors:-0} -le 0 ]
+then
+ myterm=${myterm%%-color}
+ colors=$(tput -T $myterm colors 2>/dev/null)
+fi
+if [ ${colors:-0} -le 0 ]
+then
+ failed "terminal $myterm does not support color"
+fi
+
+printf "System colors:\n"
+
+color=0
+inrow=$colors
+to_do=$colors
+[ $colors -gt 256 ] && colors=256
+[ $inrow -gt 8 ] && inrow=8
+[ $to_do -gt 16 ] && to_do=16
+while [ $color -lt $to_do ]
+do
+ [ $color = $inrow ] && newline
+ tput setab $color
+ printf ' '
+ color=$(expr $color + 1)
+done
+newline
+
+[ $colors -le 16 ] && exit
+
+if [ $colors = 256 ]
+then
+ cube=6
+ ramp=232
+elif [ $colors -ge 88 ]
+then
+ cube=4
+ ramp=80
+else
+ exit
+fi
+
+printf "\n"
+printf "Color cube, ${cube}x${cube}x${cube}:\n"
+g=0
+cube2=$(expr $cube \* $cube)
+while [ $g -lt $cube ]
+do
+ r=0
+ while [ $r -lt $cube ]
+ do
+ b=0
+ while [ $b -lt $cube ]
+ do
+ color=$(expr 16 + \( $r \* $cube2 \) + \( $g \* $cube \) + $b)
+ tput setab $color
+ printf ' '
+ b=$(expr $b + 1)
+ done
+ tput op
+ printf ' '
+ r=$(expr $r + 1)
+ done
+ newline
+ g=$(expr $g + 1)
+done
+
+printf "\n"
+printf "Grayscale ramp:\n"
+color=$ramp
+while [ $color -lt $colors ]
+do
+ tput setab $color
+ printf ' '
+ color=$(expr $color + 1)
+done
+newline
+# vi:ts=4 sw=4
diff --git a/test/tput-initc b/test/tput-initc
new file mode 100755
index 0000000..9d71c4f
--- /dev/null
+++ b/test/tput-initc
@@ -0,0 +1,156 @@
+#!/bin/sh
+##############################################################################
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 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 "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: tput-initc,v 1.6 2020/02/02 23:34:34 tom Exp $
+# Some of the ".dat" files in ncurses' test-directory give r/g/b numbers for
+# default palettes of xterm and Linux console. This script reads the numbers
+# and (assuming the same or compatible terminal) uses tput to (re)initialize
+# the palette using those numbers.
+
+failed() {
+ printf "?? $*\n" >&2
+ exit 1
+}
+
+usage() {
+ cat >&2 <<-EOF
+ usage: $0 [-r] [-s] [palette-data]
+
+ Use this script with a palette data-file to (re)initialize colors with
+ tput. This script assumes arrangements for 16-, 88- and 256-colors
+ like the xterm 88colors2.pl and 256colors2.pl scripts.
+
+ Options:
+ -r reverse palette
+ -s reverse system colors (first 16 if more than 16 colors)
+EOF
+ exit 1
+}
+
+opt_r=no
+opt_s=no
+
+while getopts "rs" option "$@"
+do
+ case $option in
+ (r)
+ opt_r=yes
+ ;;
+ (s)
+ opt_s=yes
+ ;;
+ (*)
+ usage
+ ;;
+ esac
+done
+shift $(expr $OPTIND - 1)
+
+if [ $# = 1 ]
+then
+ file=$1
+elif [ $# = 0 ]
+then
+ file=$TERM.dat
+else
+ failed "expected one parameter or none"
+fi
+
+if [ ! -f "$file" ]
+then
+ if [ -f "$file.dat" ]
+ then
+ file="$file.dat"
+ else
+ failed "no such file: $file"
+ fi
+fi
+
+myterm=${file%%.dat}
+colors=$(tput -T $myterm colors 2>/dev/null)
+if [ ${colors:-0} -le 0 ]
+then
+ myterm=${myterm%%-color}
+ colors=$(tput -T $myterm colors 2>/dev/null)
+fi
+if [ ${colors:-0} -le 0 ]
+then
+ failed "terminal $myterm does not support color"
+fi
+
+cat $file |\
+awk -v opt_r=$opt_r \
+ -v opt_s=$opt_s \
+ -v colors=$colors \
+ -v myterm=$myterm '
+BEGIN {
+ limit = 1000;
+ range = -1;
+ cramp = -1;
+ if ( colors == 88 ) {
+ cramp = 80;
+ } else if ( colors = 256 ) {
+ cramp = 232;
+ }
+}
+function scaled(n) {
+ return (n * 1000)/limit;
+}
+
+/^scale:[0-9]+/{
+ sub("^scale:","",$0);
+ limit = $0;
+}
+
+/^[0-9]+:/{
+ sub(":","",$1);
+ item = $1 + 0;
+ if (range < item) {
+ range = item;
+ }
+ params[$1] = sprintf ("%d %d %d", scaled($2),scaled($3),scaled($4));
+}
+END {
+ for (n = 0; n <= range; ++n) {
+ m = n;
+ if ( opt_r == "yes" ) {
+ if ( colors <= 16 ) {
+ m = range - n;
+ } else if ( ( opt_s == "yes" ) && ( n < 16 ) ) {
+ m = 15 - n;
+ } else if ( n >= cramp ) {
+ m = cramp + colors - 1 - n;
+ } else {
+ m = 16 + cramp - 1 - n;
+ }
+ }
+ printf "tput -T%s initc %d %s\n", myterm, m, params[n];
+ }
+}
+' |sh -
diff --git a/test/tracemunch b/test/tracemunch
index 1ea6f4b..22191ee 100755
--- a/test/tracemunch
+++ b/test/tracemunch
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
-# $Id: tracemunch,v 1.6 2005/03/12 21:48:23 tom Exp $
+#!/usr/bin/env perl
+# $Id: tracemunch,v 1.27 2020/02/02 23:34:34 tom Exp $
##############################################################################
-# Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. #
+# Copyright 2018-2019,2020 Thomas E. Dickey #
+# Copyright 1998-2005,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"), #
@@ -32,130 +33,557 @@
# The error logs produced by ncurses with tracing enabled can be very tedious
# to wade through. This script helps by compacting runs of log lines that
# can be conveniently expressed as higher-level operations.
+
use strict;
+use warnings;
+
+our $putattr =
+ 'PutAttrChar\(\{\{ ' . "'(.)'"
+ . ' = 0[0-7]+ \}\}\) at \(([0-9]+), ([0-9]+)\)';
+our $waddnstr =
+ 'waddnstr\(0x([[:xdigit:]]+),"([^\"]+)",[0-9]+\) called \{A_NORMAL\}';
-our $putattr="PutAttrChar\\({{ '(.)' = 0[0-7]+ }}\\) at \\(([0-9]+), ([0-9]+)\\)";
-our $waddnstr="waddnstr\\(0x([0-9a-f]+),\"([^\"]+)\",[0-9]+\\) called {A_NORMAL}";
+# If the trace is complete, we can infer addresses using the return value from
+# newwin, etc. But if it is incomplete, we can still check for special cases
+# such as SCREEN* and WINDOW* parameters. In this table, the type for the
+# first parameter is encoded, relying upon an ncurses programming convention:
+# 1 = SCREEN*
+# 2 = WINDOW*
+# 4 = TERMINAL*
+our %known_p1 = qw(
+ TransformLine 1
+ _nc_freewin 2
+ _nc_initscr 1
+ _nc_makenew 1
+ _nc_mingw_console_read 1
+ _nc_reset_colors 1
+ _nc_scroll_optimize 1
+ _nc_tinfo 1
+ _nc_tinfo_mvcur 1
+ _nc_wgetch 2
+ adjust_window 2
+ assume_default_colors 1
+ attr_get 2
+ baudrate 1
+ beep 1
+ border_set 2
+ box 2
+ box_set 2
+ can_change_color 1
+ cbreak 1
+ clearok 2
+ color_content 1
+ copywin 2
+ curs_set 1
+ decrease_size 1
+ def_prog_mode 1
+ def_shell_mode 1
+ define_key 1
+ del_curterm 1
+ delay_output 1
+ delscreen 1
+ delwin 2
+ derwin 2
+ doupdate 1
+ dupwin 2
+ echo 1
+ endwin 1
+ erasechar 1
+ filter 1
+ flash 1
+ flushinp 1
+ getattrs 2
+ getbegx 2
+ getbegy 2
+ getbkgd 2
+ getcurx 2
+ getcury 2
+ getmaxx 2
+ getmaxy 2
+ getmouse 1
+ getparx 2
+ getpary 2
+ halfdelay 1
+ has_ic 1
+ has_il 1
+ has_key 1
+ idcok 2
+ idlok 2
+ immedok 2
+ increase_size 1
+ init_color 1
+ init_pair 1
+ intrflush 1
+ is_cleared 2
+ is_idcok 2
+ is_idlok 2
+ is_immedok 2
+ is_keypad 2
+ is_leaveok 2
+ is_linetouched 2
+ is_nodelay 2
+ is_notimeout 2
+ is_pad 2
+ is_scrollok 2
+ is_subwin 2
+ is_syncok 2
+ is_term_resized 1
+ is_wintouched 2
+ key_defined 1
+ keybound 1
+ keyok 1
+ keypad 2
+ killchar 1
+ leaveok 2
+ longname 1
+ meta 2
+ mouseinterval 1
+ mousemask 1
+ mvcur 1
+ mvderwin 2
+ mvwadd_wch 2
+ mvwadd_wchnstr 2
+ mvwadd_wchstr 2
+ mvwaddch 2
+ mvwaddchnstr 2
+ mvwaddchstr 2
+ mvwaddnstr 2
+ mvwaddnwstr 2
+ mvwaddstr 2
+ mvwaddwstr 2
+ mvwchgat 2
+ mvwdelch 2
+ mvwget_wch 2
+ mvwget_wstr 2
+ mvwgetch 2
+ mvwgetn_wstr 2
+ mvwgetnstr 2
+ mvwgetstr 2
+ mvwhline 2
+ mvwhline_set 2
+ mvwin 2
+ mvwin_wch 2
+ mvwin_wchnstr 2
+ mvwin_wchstr 2
+ mvwinch 2
+ mvwinchnstr 2
+ mvwinchstr 2
+ mvwins_nwstr 2
+ mvwins_wch 2
+ mvwins_wstr 2
+ mvwinsch 2
+ mvwinsnstr 2
+ mvwinsstr 2
+ mvwinstr 2
+ mvwinwstr 2
+ mvwvline 2
+ mvwvline_set 2
+ newpad 1
+ newterm 1
+ newwin 1
+ nl 1
+ nocbreak 1
+ nodelay 2
+ noecho 1
+ nofilter 1
+ nonl 1
+ noqiflush 1
+ noraw 1
+ notimeout 2
+ overlap 2
+ overlay 2
+ overwrite 2
+ pair_content 1
+ pecho_wchar 2
+ pechochar 2
+ pnoutrefresh 2
+ putwin 2
+ qiflush 1
+ raw 1
+ redrawwin 2
+ reset_prog_mode 1
+ reset_shell_mode 1
+ resetty 1
+ resize_term 1
+ resizeterm 1
+ restartterm 1
+ ripoffline 1
+ savetty 1
+ scr_init 1
+ scr_restore 1
+ scr_set 1
+ scroll 2
+ scrollok 2
+ set_curterm 4
+ set_term 1
+ slk_attr 1
+ slk_attr_set 1
+ slk_attroff 1
+ slk_attron 1
+ slk_attrset 1
+ slk_clear 1
+ slk_color 1
+ slk_init 1
+ slk_label 1
+ slk_noutrefresh 1
+ slk_refresh 1
+ slk_restore 1
+ slk_set 1
+ slk_touch 1
+ start_color 1
+ subwin 2
+ syncok 2
+ termattrs 1
+ termname 1
+ tgetflag 1
+ tgetnum 1
+ tigetflag 1
+ tigetnum 1
+ tigetstr 1
+ tinfo 1
+ touchline 2
+ touchwin 2
+ typeahead 1
+ unget_wch 1
+ ungetch 1
+ ungetmouse 1
+ untouchwin 2
+ use_default_colors 1
+ use_env 1
+ use_legacy_coding 1
+ use_screen 1
+ use_tioctl 1
+ use_window 2
+ vidattr 1
+ vidputs 1
+ vw_printw 2
+ vwprintw 2
+ wadd_wch 2
+ wadd_wchnstr 2
+ wadd_wchstr 2
+ waddch 2
+ waddchnstr 2
+ waddchstr 2
+ waddnstr 2
+ waddnwstr 2
+ waddstr 2
+ waddwstr 2
+ wattr_get 2
+ wattr_off 2
+ wattr_on 2
+ wattr_set 2
+ wattroff 2
+ wattron 2
+ wattrset 2
+ wbkgd 2
+ wbkgdset 2
+ wborder 2
+ wborder_set 2
+ wchgat 2
+ wclear 2
+ wclrtobot 2
+ wclrtoeol 2
+ wcolor_set 2
+ wcursyncup 2
+ wdelch 2
+ wdeleteln 2
+ wechochar 2
+ wenclose 2
+ werase 2
+ wget_wch 2
+ wget_wstr 2
+ wgetbkgrnd 2
+ wgetch 2
+ wgetch_events 2
+ wgetdelay 2
+ wgetn_wstr 2
+ wgetnstr 2
+ wgetparent 2
+ wgetscrreg 2
+ wgetstr 2
+ whline 2
+ whline_set 2
+ win_wch 2
+ win_wchnstr 2
+ win_wchstr 2
+ winch 2
+ winchnstr 2
+ winchstr 2
+ winnstr 2
+ winnwstr 2
+ wins_nwstr 2
+ wins_wch 2
+ wins_wstr 2
+ winsch 2
+ winsdelln 2
+ winsertln 2
+ winsnstr 2
+ winsstr 2
+ winstr 2
+ winwstr 2
+ wmouse_trafo 2
+ wmove 2
+ wnoutrefresh 2
+ wprintw 2
+ wredrawln 2
+ wrefresh 2
+ wresize 2
+ wscrl 2
+ wsetscrreg 2
+ wstandend 2
+ wstandout 2
+ wsyncdown 2
+ wsyncup 2
+ wtimeout 2
+ wtouchln 2
+ wvline 2
+);
-our $win_nums=0;
-our $curscr="";
-our $newscr="";
-our $stdscr="";
-our @win_addr;
+our $scr_nums = 0;
+our $thr_nums = 0;
+our $trm_nums = 0;
+our $try_nums = 0;
+our $win_nums = 0;
+our $curscr = "";
+our $newscr = "";
+our $stdscr = "";
+our %scr_addr;
+our %thr_addr;
+our %trm_addr;
+our %try_addr;
+our %win_addr;
+
+sub has_addr($) {
+ my $value = shift;
+ my $result = 0;
+ $result = 1 if ( $value =~ /\b0x[[:xdigit:]]+\b/i );
+ return $result;
+}
-sub transaddr
-{
+sub transaddr($) {
+ my $arg = shift;
my $n;
- my $arg = $_[0];
- $arg =~ s/$curscr/curscr/g if ($curscr);
- $arg =~ s/$newscr/newscr/g if ($newscr);
- $arg =~ s/$stdscr/stdscr/g if ($stdscr);
- for $n (0..$#win_addr) {
- $arg =~ s/$win_addr[$n]/window$n/g if $win_addr[$n];
+ $arg =~ s/\b$curscr\b/curscr/g if ($curscr);
+ $arg =~ s/\b$newscr\b/newscr/g if ($newscr);
+ $arg =~ s/\b$stdscr\b/stdscr/g if ($stdscr);
+ if ( &has_addr($arg) ) {
+ foreach my $addr ( keys %scr_addr ) {
+ $n = $scr_addr{$addr};
+ $arg =~ s/\b$addr\b/screen$n/g if ( defined $n );
+ }
+ }
+ if ( &has_addr($arg) ) {
+ foreach my $addr ( keys %thr_addr ) {
+ $n = $thr_addr{$addr};
+ $arg =~ s/\b$addr\b/thread$n/g if ( defined $n );
+ }
+ }
+ if ( &has_addr($arg) ) {
+ foreach my $addr ( keys %trm_addr ) {
+ $n = $trm_addr{$addr};
+ $arg =~ s/\b$addr\b/terminal$n/g if ( defined $n );
+ }
+ }
+ if ( &has_addr($arg) ) {
+ foreach my $addr ( keys %try_addr ) {
+ $n = $try_addr{$addr};
+ $arg =~ s/\b$addr\b/tries_$n/g if ( defined $n );
+ }
+ }
+ if ( &has_addr($arg) ) {
+ foreach my $addr ( keys %win_addr ) {
+ $n = $win_addr{$addr};
+ $arg =~ s/\b$addr\b/window$n/g if ( defined $n );
+ }
+ }
+ if ( &has_addr($arg) ) {
+ if ( $arg =~ /add_wch\((window\d+,)?0x[[:xdigit:]]+\)/i ) {
+ $arg =~ s/(0x[[:xdigit:]]+)[)]/\&wch)/i;
+ }
+ elsif (
+ $arg =~ /color_content\((screen\d+,)?\d+(,0x[[:xdigit:]]+){3}/i )
+ {
+ $arg =~ s/(,0x[[:xdigit:]]+){3}[)]/,\&r,\&g,\&b)/i;
+ }
+ elsif ( $arg =~ /pair_content\((screen\d+,)?\d+(,0x[[:xdigit:]]+){2}/i )
+ {
+ $arg =~ s/(,0x[[:xdigit:]]+){2}[)]/,\&fg,\&bg)/i;
+ }
+ }
+ if ( &has_addr($arg) and $arg =~ /called\s+\{/ ) {
+ my $func = $arg;
+ chomp $func;
+ $func =~ s/^.*called\s+\{([[:alnum:]_]+)\(.*$/$1/;
+ if ( defined $known_p1{$func} ) {
+ my $addr = $arg;
+ my $type = $known_p1{$func};
+ chomp $addr;
+ $addr =~ s/^[^(]+\((0x[[:xdigit:]]+).*/$1/i;
+ if ( $type == 1 ) {
+ $scr_addr{$addr} = ++$scr_nums;
+ $arg = &transaddr($arg);
+ }
+ elsif ( $type == 2 ) {
+ $win_addr{$addr} = ++$win_nums;
+ $arg = &transaddr($arg);
+ }
+ elsif ( $type == 4 ) {
+ $trm_addr{$addr} = ++$trm_nums;
+ $arg = &transaddr($arg);
+ }
+ }
}
return $arg;
}
-while (<STDIN>)
-{
- my $addr;
- my $n;
- my $awaiting;
-
-CLASSIFY: {
- # Transform window pointer addresses so it's easier to compare logs
- $awaiting = "curscr" if ($_ =~ /creating curscr/);
- $awaiting = "newscr" if ($_ =~ /creating newscr/);
- $awaiting = "stdscr" if ($_ =~ /creating stdscr/);
- if ($_ =~ /^create :window 0x([0-9a-f]+)/) {
- $addr = "0x$1";
- if ($awaiting eq "curscr") {
- $curscr = $addr;
- } elsif ($awaiting eq "newscr") {
- $newscr = $addr;
- } elsif ($awaiting eq "stdscr") {
- $stdscr = $addr;
- } else {
- $win_addr[$win_nums] = $addr;
- $win_nums = $win_nums + 1;
- }
- $awaiting = "";
- } elsif ($_ =~ /^\.\.\.deleted win=0x([0-9a-f]+)/) {
- $addr = "0x$1";
- $_ = &transaddr($_);
- if ($addr eq $curscr) {
- $curscr = "";
- } elsif ($addr eq $newscr) {
- $newscr = "";
- } elsif ($addr eq $stdscr) {
- $stdscr = "";
- } else {
- for $n (0..$#win_addr) {
- if ($win_addr[$n] eq $addr) {
- $win_addr[$n] = "";
- }
- }
- }
- }
-
- # Compactify runs of PutAttrChar calls (TR_CHARPUT)
- if ($_ =~ /$putattr/)
- {
- my $putattr_chars = $1;
- my $starty = $2;
- my $startx = $3;
- while (<STDIN>)
- {
- if ($_ =~ /$putattr/) {
- $putattr_chars .= $1;
- } else {
- last;
- }
- }
- print "RUN of PutAttrChar()s: \"$putattr_chars\" from ${starty}, ${startx}\n";
- redo CLASSIFY;
- }
-
- # Compactify runs of waddnstr calls (TR_CALLS)
- if ($_ =~ /$waddnstr/)
- {
- my $waddnstr_chars = $2;
- my $winaddr = $1;
- while (<STDIN>)
- {
- if ($_ =~ /$waddnstr/ && $1 eq $winaddr) {
- $waddnstr_chars .= $2;
- } else {
- last;
- }
- }
- my $winaddstr = &transaddr($winaddr);
- print "RUN of waddnstr()s: $winaddr, \"$waddnstr_chars\"\n";
- redo CLASSIFY;
- }
-
- # More transformations can go here
-
- # Repeated runs of anything
- my $anyline = &transaddr($_);
- my $repeatcount = 1;
- while (<STDIN>) {
- if (&transaddr($_) eq $anyline) {
- $repeatcount++;
- } else {
- last;
- }
- }
- if ($repeatcount > 1) {
- print "${repeatcount} REPEATS OF $anyline";
- } else {
- print $anyline
- }
- redo CLASSIFY if $_;
-
- } # :CLASSIFY
+sub muncher($) {
+ my $STDIN = shift;
+
+ while (<$STDIN>) {
+ my $addr;
+ my $n;
+ my $awaiting = "";
+
+ CLASSIFY: {
+
+ # just in case someone tries a file with cr/lf line-endings:
+ $_ =~ s/\r\n/\n/g;
+ $_ =~ s/\r/\n/g;
+
+ my $thread = "";
+ if ( $_ =~ /^(0x[[:xdigit:]]+):/ ) {
+ $thr_addr{$1} = ++$thr_nums unless defined $thr_addr{$1};
+ $thread = "thread" . $thr_addr{$1} . ":";
+ $_ =~ s/^[^:]*://;
+ }
+
+ # Transform window pointer addresses so it's easier to compare logs
+ $awaiting = "curscr" if ( $_ =~ /creating curscr/ );
+ $awaiting = "newscr" if ( $_ =~ /creating newscr/ );
+ $awaiting = "stdscr" if ( $_ =~ /creating stdscr/ );
+ $awaiting = "screen" if ( $_ =~ /^(\+ )*called \{new_prescr\(\)/ );
+ if ( $_ =~ /^create :window 0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$1";
+ if ( $awaiting eq "curscr" ) {
+ $curscr = $addr;
+ }
+ elsif ( $awaiting eq "newscr" ) {
+ $newscr = $addr;
+ }
+ elsif ( $awaiting eq "stdscr" ) {
+ $stdscr = $addr;
+ }
+ else {
+ $win_addr{$addr} = $win_nums++;
+ }
+ $awaiting = "";
+ }
+ elsif ( $_ =~ /^(\+ )*called \{set_curterm\((0x[[:xdigit:]]+)\)/ ) {
+ $trm_addr{$2} = ++$trm_nums unless defined $trm_addr{$2};
+ }
+ elsif ( $_ =~ /^(\+ )*called \{_nc_add_to_try\((0x[[:xdigit:]]+),/ )
+ {
+ $try_addr{$2} = ++$try_nums unless defined $try_addr{$2};
+ }
+ elsif ( $_ =~ /^(\+ )*_nc_alloc_screen_sp 0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$2";
+ $scr_addr{$addr} = ++$scr_nums unless ( $scr_addr{$addr} );
+ $awaiting = "";
+ }
+ elsif ( $_ =~ /^(\+ )*return }0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$2";
+ if ( $awaiting eq "screen" ) {
+ $scr_addr{$addr} = ++$scr_nums unless ( $scr_addr{$addr} );
+ }
+ }
+ elsif ( $_ =~ /^\.\.\.deleted win=0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$1";
+ $_ = &transaddr($_);
+ if ( $addr eq $curscr ) {
+ $curscr = "";
+ }
+ elsif ( $addr eq $newscr ) {
+ $newscr = "";
+ }
+ elsif ( $addr eq $stdscr ) {
+ $stdscr = "";
+ }
+ else {
+ undef $win_addr{$addr};
+ }
+ }
+
+ # Compactify runs of PutAttrChar calls (TR_CHARPUT)
+ if ( $_ =~ /$putattr/ ) {
+ my $putattr_chars = $1;
+ my $starty = $2;
+ my $startx = $3;
+ while (<$STDIN>) {
+ if ( $_ =~ /$putattr/ ) {
+ $putattr_chars .= $1;
+ }
+ else {
+ last;
+ }
+ }
+ print
+"RUN of PutAttrChar()s: \"$putattr_chars\" from ${starty}, ${startx}\n";
+ redo CLASSIFY;
+ }
+
+ # Compactify runs of waddnstr calls (TR_CALLS)
+ if ( $_ =~ /$waddnstr/ ) {
+ my $waddnstr_chars = $2;
+ my $winaddr = $1;
+ while (<$STDIN>) {
+ if ( $_ =~ /$waddnstr/ && $1 eq $winaddr ) {
+ $waddnstr_chars .= $2;
+ }
+ else {
+ last;
+ }
+ }
+ my $winaddstr = &transaddr($winaddr);
+ print "RUN of waddnstr()s: $winaddr, \"$waddnstr_chars\"\n";
+ redo CLASSIFY;
+ }
+
+ # More transformations can go here
+
+ # Repeated runs of anything
+ my $anyline = &transaddr($_);
+ my $repeatcount = 1;
+ while (<$STDIN>) {
+ if ( &transaddr($_) eq $anyline ) {
+ $repeatcount++;
+ }
+ else {
+ last;
+ }
+ }
+ if ( $repeatcount > 1 ) {
+ print "${repeatcount} REPEATS OF $anyline";
+ }
+ else {
+ print $thread . $anyline;
+ }
+ redo CLASSIFY if $_;
+
+ } # :CLASSIFY
+ }
+}
+
+if ( $#ARGV >= 0 ) {
+ while ( $#ARGV >= 0 ) {
+ my $file = shift @ARGV;
+ open my $ifh, "<", $file or die $!;
+ &muncher($ifh);
+ }
+}
+else {
+ &muncher( \*STDIN );
}
# tracemunch ends here
diff --git a/test/view.c b/test/view.c
index 4782d85..e4d746f 100644
--- a/test/view.c
+++ b/test/view.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 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 +34,8 @@
*
* modified by Thomas Dickey <dickey@clark.net> July 1995 to demonstrate
* the use of 'resizeterm()', and May 2000 to illustrate wide-character
- * handling.
+ * handling. This program intentionally does not use pads, to allow testing
+ * with less-capable implementations of curses.
*
* Takes a filename argument. It's a simple file-viewer with various
* scroll-up and scroll-down commands.
@@ -50,55 +52,19 @@
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.94 2013/09/28 21:58:42 tom Exp $
+ * $Id: view.c,v 1.138 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
#include <widechars.h>
+#include <popup_msg.h>
+#include <sys/stat.h>
#include <time.h>
-#undef CTRL /* conflict on AIX 5.2 with <sys/ioctl.h> */
-
-#if HAVE_TERMIOS_H
-# include <termios.h>
-#else
-#if !defined(__MINGW32__)
-# include <sgtty.h>
-#endif
-#endif
-
-#if !defined(sun) || !HAVE_TERMIOS_H
-# if HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-# endif
-#endif
-
-#define my_pair 1
-
-/* This is needed to compile 'struct winsize' */
-#if NEED_PTEM_H
-#include <sys/stream.h>
-#include <sys/ptem.h>
-#endif
-
-#undef CTRL
-#define CTRL(x) ((x) & 0x1f)
-
static void finish(int sig) GCC_NORETURN;
-static void show_all(const char *tag);
-
-#if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZE_TERM
-#define CAN_RESIZE 1
-#else
-#define CAN_RESIZE 0
-#endif
-#if CAN_RESIZE
-static void adjust(int sig);
-static int interrupted;
-static bool waiting = FALSE;
-#endif
+#define my_pair 1
static int shift = 0;
static bool try_color = FALSE;
@@ -108,36 +74,22 @@ static NCURSES_CH_T **vec_lines;
static NCURSES_CH_T **lptr;
static int num_lines;
+#if USE_WIDEC_SUPPORT
+static bool n_option = FALSE;
+#endif
+
static void usage(void) GCC_NORETURN;
static void
-usage(void)
+failed(const char *msg)
{
- static const char *msg[] =
- {
- "Usage: view [options] file"
- ,""
- ,"Options:"
- ," -c use color if terminal supports it"
- ," -i ignore INT, QUIT, TERM signals"
- ," -n NUM specify maximum number of lines (default 1000)"
-#if defined(KEY_RESIZE)
- ," -r use old-style sigwinch handler rather than KEY_RESIZE"
-#endif
- ," -s start in single-step mode, waiting for input"
-#ifdef TRACE
- ," -t trace screen updates"
- ," -T NUM specify trace mask"
-#endif
- };
- size_t n;
- for (n = 0; n < SIZEOF(msg); n++)
- fprintf(stderr, "%s\n", msg[n]);
+ endwin();
+ fprintf(stderr, "%s\n", msg);
ExitProgram(EXIT_FAILURE);
}
static int
-ch_len(NCURSES_CH_T * src)
+ch_len(NCURSES_CH_T *src)
{
int result = 0;
#if USE_WIDEC_SUPPORT
@@ -147,7 +99,8 @@ ch_len(NCURSES_CH_T * src)
#if USE_WIDEC_SUPPORT
for (;;) {
TEST_CCHAR(src, count, {
- ++result;
+ int len = wcwidth(test_wch[0]);
+ result += (len > 0) ? len : 1;
++src;
}
, {
@@ -161,110 +114,334 @@ ch_len(NCURSES_CH_T * src)
return result;
}
-/*
- * Allocate a string into an array of chtype's. If UTF-8 mode is
- * active, translate the string accordingly.
- */
-static NCURSES_CH_T *
-ch_dup(char *src)
+static void
+finish(int sig)
+{
+ endwin();
+#if NO_LEAKS
+ if (vec_lines != 0) {
+ int n;
+ for (n = 0; n < num_lines; ++n) {
+ free(vec_lines[n]);
+ }
+ free(vec_lines);
+ }
+#endif
+ ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+
+static void
+show_all(const char *tag)
{
- unsigned len = (unsigned) strlen(src);
- NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1);
- size_t j, k;
+ int i;
+ int digits;
+ char temp[BUFSIZ];
+ NCURSES_CH_T *s;
+ time_t this_time;
+
+ for (digits = 1, i = num_lines; i > 0; i /= 10) {
+ ++digits;
+ }
+
+ _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+ "view %.*s", (int) strlen(tag), tag);
+ i = (int) strlen(temp);
+ _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i)
+ " %.*s", (int) sizeof(temp) - i - 2, fname);
+ move(0, 0);
+ printw("%.*s", COLS, temp);
+ clrtoeol();
+ this_time = time((time_t *) 0);
+ _nc_STRNCPY(temp, ctime(&this_time), (size_t) 30);
+ if ((i = (int) strlen(temp)) != 0) {
+ temp[--i] = 0;
+ if (move(0, COLS - i - 2) != ERR)
+ printw(" %s", temp);
+ }
+
+ scrollok(stdscr, FALSE); /* prevent screen from moving */
+ for (i = 1; i < LINES; i++) {
+ int len;
+ int actual = (int) (lptr + i - vec_lines);
+ if (actual > num_lines) {
+ if (i < LINES - 1) {
+ int y, x;
+ getyx(stdscr, y, x);
+ move(i, 0);
+ clrtobot();
+ move(y, x);
+ }
+ break;
+ }
+ move(i, 0);
+ printw("%*d:", digits, actual);
+ clrtoeol();
+ if ((s = lptr[i - 1]) == 0) {
+ continue;
+ }
+ len = ch_len(s);
+ if (len > shift) {
#if USE_WIDEC_SUPPORT
- wchar_t wstr[CCHARW_MAX + 1];
- wchar_t wch;
- int l = 0;
- size_t rc;
+ /*
+ * An index into an array of cchar_t's is not necessarily the same
+ * as the column-offset. A pad would do this directly. Here we
+ * must translate (or compute a table of offsets).
+ */
+ {
+ int j;
+ int width = 1, count;
+ for (j = actual = 0; j < shift; ++j) {
+ TEST_CCHAR(s + j, count, {
+ width = wcwidth(test_wch[0]);
+ }
+ , {
+ width = 1;
+ });
+ actual += width;
+ if (actual > shift) {
+ break;
+ } else if (actual == shift) {
+ ++j;
+ break;
+ }
+ }
+ if (actual < len) {
+ if (actual > shift)
+ addch('<');
+ add_wchstr(s + j + (actual > shift));
+ }
+ }
+#else
+ addchstr(s + shift);
+#endif
+ }
+#if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT)
+ if (try_color)
+ wchgat(stdscr, -1, WA_NORMAL, my_pair, NULL);
+#endif
+ }
+ setscrreg(1, LINES - 1);
+ scrollok(stdscr, TRUE);
+ refresh();
+}
+
+static void
+read_file(const char *filename)
+{
+ FILE *fp;
+ int pass;
+ int k;
int width;
+ size_t j;
+ size_t len;
+ struct stat sb;
+ char *my_blob;
+ char **my_vec = 0;
+ WINDOW *my_win;
+
+ if (stat(filename, &sb) != 0
+ || (sb.st_mode & S_IFMT) != S_IFREG) {
+ failed("input is not a file");
+ }
+
+ if (sb.st_size == 0) {
+ failed("input is empty");
+ }
+
+ if ((fp = fopen(filename, "r")) == 0) {
+ failed("cannot open input-file");
+ }
+
+ if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0) {
+ failed("cannot allocate memory for input-file");
+ }
+
+ len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+ my_blob[sb.st_size] = '\0';
+ fclose(fp);
+
+ for (pass = 0; pass < 2; ++pass) {
+ char *base = my_blob;
+ k = 0;
+ for (j = 0; j < len; ++j) {
+ if (my_blob[j] == '\n') {
+ if (pass) {
+ my_vec[k] = base;
+ my_blob[j] = '\0';
+ }
+ base = my_blob + j + 1;
+ ++k;
+ }
+ }
+ num_lines = k;
+ if (base != (my_blob + j))
+ ++num_lines;
+ if (!pass &&
+ ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+ failed("cannot allocate line-vector #1");
+ }
+ }
+
+#if USE_WIDEC_SUPPORT
+ if (!memcmp("\357\273\277", my_blob, 3)) {
+ char *s = my_blob + 3;
+ char *d = my_blob;
+ Trace(("trim BOM"));
+ do {
+ } while ((*d++ = *s++) != '\0');
+ }
+#endif
+
+ width = (int) strlen(my_vec[0]);
+ for (k = 1; my_vec[k]; ++k) {
+ int check = (int) (my_vec[k] - my_vec[k - 1]);
+ if (width < check)
+ width = check;
+ }
+ width = (width + 1) * 5;
+ my_win = newwin(2, width, 0, 0);
+ if (my_win == 0) {
+ failed("cannot allocate temporary window");
+ }
+
+ if ((vec_lines = typeCalloc(NCURSES_CH_T *, (size_t) num_lines + 2)) == 0) {
+ failed("cannot allocate line-vector #2");
+ }
+
+ /*
+ * Use the curses library for rendering, including tab-conversion. This
+ * will not make the resulting array's indices correspond to column for
+ * lines containing double-width cells because the "in_wch" functions will
+ * ignore the skipped cells. Use pads for that sort of thing.
+ */
+ Trace(("slurp the file"));
+ for (k = 0; my_vec[k]; ++k) {
+ char *s;
+ int y, x;
+#if USE_WIDEC_SUPPORT
+ char *last = my_vec[k] + (int) strlen(my_vec[k]);
+ wchar_t wch[2];
+ size_t rc;
#ifndef state_unused
- mbstate_t state;
+ mbstate_t state;
#endif
#endif /* USE_WIDEC_SUPPORT */
+ werase(my_win);
+ wmove(my_win, 0, 0);
#if USE_WIDEC_SUPPORT
- reset_mbytes(state);
+ wch[1] = 0;
+ reset_mbytes(state);
#endif
- for (j = k = 0; j < len; j++) {
+ for (s = my_vec[k]; *s != '\0'; ++s) {
#if USE_WIDEC_SUPPORT
- rc = (size_t) check_mbytes(wch, src + j, len - j, state);
- if (rc == (size_t) -1 || rc == (size_t) -2)
- break;
- j += rc - 1;
- if ((width = wcwidth(wch)) < 0)
- break;
- if ((width > 0 && l > 0) || l == CCHARW_MAX) {
- wstr[l] = L'\0';
- l = 0;
- if (setcchar(dst + k, wstr, 0, 0, NULL) != OK)
- break;
- ++k;
+ if (!n_option) {
+ rc = (size_t) check_mbytes(wch[0], s, (size_t) (last - s), state);
+ if ((long) rc == -1 || (long) rc == -2) {
+ break;
+ }
+ s += rc - 1;
+ waddwstr(my_win, wch);
+ } else
+#endif
+ waddch(my_win, *s & 0xff);
+ }
+ getyx(my_win, y, x);
+ if (y)
+ x = width - 1;
+ wmove(my_win, 0, 0);
+ /* "x + 1" works with standard curses; some implementations are buggy */
+ if ((vec_lines[k] = typeCalloc(NCURSES_CH_T, x + width + 1)) == 0) {
+ failed("cannot allocate line-vector #3");
}
- if (width == 0 && l == 0)
- wstr[l++] = L' ';
- wstr[l++] = wch;
+#if USE_WIDEC_SUPPORT
+ win_wchnstr(my_win, vec_lines[k], x);
#else
- dst[k++] = (chtype) UChar(src[j]);
+ winchnstr(my_win, vec_lines[k], x);
#endif
}
+
+ delwin(my_win);
+ free(my_vec);
+ free(my_blob);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: view [options] file"
+ ,""
+ ,"Options:"
+ ," -c use color if terminal supports it"
+ ," -i ignore INT, QUIT, TERM signals"
#if USE_WIDEC_SUPPORT
- if (l > 0) {
- wstr[l] = L'\0';
- if (setcchar(dst + k, wstr, 0, 0, NULL) == OK)
- ++k;
- }
- wstr[0] = L'\0';
- setcchar(dst + k, wstr, 0, 0, NULL);
-#else
- dst[k] = 0;
+ ," -n use waddch (bytes) rather then wadd_wch (wide-chars)"
#endif
- return dst;
+ ," -s start in single-step mode, waiting for input"
+#ifdef TRACE
+ ," -t trace screen updates"
+ ," -T NUM specify trace mask"
+#endif
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
}
int
main(int argc, char *argv[])
{
- int MAXLINES = 1000;
- FILE *fp;
- char buf[BUFSIZ];
+ 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",
+ " <,> - scroll the viewport left/right by 8 columns",
+ "",
+ " h,<Home> - scroll the viewport to top of file",
+ " ^F,<PageDn> - scroll to the next page",
+ " ^B,<PageUp> - scroll to the previous page",
+ " 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 i;
int my_delay = 0;
NCURSES_CH_T **olptr;
int value = 0;
bool done = FALSE;
bool got_number = FALSE;
+ bool ignore_sigs = FALSE;
bool single_step = FALSE;
-#if CAN_RESIZE
- bool nonposix_resize = FALSE;
-#endif
const char *my_label = "Input";
setlocale(LC_ALL, "");
-#ifndef NCURSES_VERSION
- /*
- * We know ncurses will catch SIGINT if we don't establish our own handler.
- * Other versions of curses may/may not catch it.
- */
- (void) signal(SIGINT, finish); /* arrange interrupts to terminate */
-#endif
-
- while ((i = getopt(argc, argv, "cin:rstT:")) != -1) {
+ while ((i = getopt(argc, argv, "cinstT:")) != -1) {
switch (i) {
case 'c':
try_color = TRUE;
break;
case 'i':
- CATCHALL(SIG_IGN);
+ ignore_sigs = TRUE;
break;
+#if USE_WIDEC_SUPPORT
case 'n':
- if ((MAXLINES = atoi(optarg)) < 1 ||
- (MAXLINES + 2) <= 1)
- usage();
- break;
-#if CAN_RESIZE
- case 'r':
- nonposix_resize = TRUE;
+ n_option = TRUE;
break;
#endif
case 's':
@@ -277,11 +454,11 @@ main(int argc, char *argv[])
int tvalue = (int) strtol(optarg, &next, 0);
if (tvalue < 0 || (next != 0 && *next != 0))
usage();
- trace((unsigned) tvalue);
+ curses_trace((unsigned) tvalue);
}
break;
case 't':
- trace(TRACE_CALLS);
+ curses_trace(TRACE_CALLS);
break;
#endif
default:
@@ -291,76 +468,7 @@ main(int argc, char *argv[])
if (optind + 1 != argc)
usage();
- if ((vec_lines = typeCalloc(NCURSES_CH_T *, (size_t) MAXLINES + 2)) == 0)
- usage();
-
- assert(vec_lines != 0);
-
- fname = argv[optind];
- if ((fp = fopen(fname, "r")) == 0) {
- perror(fname);
- ExitProgram(EXIT_FAILURE);
- }
-#if CAN_RESIZE
- if (nonposix_resize)
- (void) signal(SIGWINCH, adjust); /* arrange interrupts to resize */
-#endif
-
- Trace(("slurp the file"));
- for (lptr = &vec_lines[0]; (lptr - vec_lines) < MAXLINES; lptr++) {
- char temp[BUFSIZ], *s, *d;
- int col;
-
- if (fgets(buf, sizeof(buf), fp) == 0)
- break;
-
-#if USE_WIDEC_SUPPORT
- if (lptr == vec_lines) {
- if (!memcmp("", buf, 3)) {
- Trace(("trim BOM"));
- s = buf + 3;
- d = buf;
- do {
- } while ((*d++ = *s++) != '\0');
- }
- }
-#endif
-
- /* convert tabs and nonprinting chars so that shift will work properly */
- for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) {
- if (*d == '\r') {
- if (s[1] == '\n')
- continue;
- else
- break;
- }
- if (*d == '\n') {
- *d = '\0';
- break;
- } else if (*d == '\t') {
- col = (col | 7) + 1;
- while ((d - temp) != col)
- *d++ = ' ';
- } else
-#if USE_WIDEC_SUPPORT
- col++, d++;
-#else
- if (isprint(UChar(*d))) {
- col++;
- d++;
- } else {
- sprintf(d, "\\%03o", UChar(*s));
- d += strlen(d);
- col = (int) (d - temp);
- }
-#endif
- }
- *lptr = ch_dup(temp);
- }
- (void) fclose(fp);
- num_lines = (int) (lptr - vec_lines);
-
- (void) initscr(); /* initialize the curses library */
+ InitAndCatch(initscr(), ignore_sigs ? SIG_IGN : finish);
keypad(stdscr, TRUE); /* enable keyboard mapping */
(void) nonl(); /* tell curses not to do NL->CR/NL on output */
(void) cbreak(); /* take input chars one at a time, no wait for \n */
@@ -369,6 +477,8 @@ main(int argc, char *argv[])
nodelay(stdscr, TRUE);
idlok(stdscr, TRUE); /* allow use of insert/delete line */
+ read_file(fname = argv[optind]);
+
if (try_color) {
if (has_colors()) {
start_color();
@@ -387,17 +497,7 @@ main(int argc, char *argv[])
show_all(my_label);
for (;;) {
-#if CAN_RESIZE
- if (interrupted) {
- adjust(0);
- my_label = "interrupt";
- }
- waiting = TRUE;
- c = getch();
- waiting = FALSE;
-#else
c = getch();
-#endif
if ((c < 127) && isdigit(c)) {
if (!got_number) {
MvPrintw(0, 0, "Count: ");
@@ -441,16 +541,48 @@ main(int argc, char *argv[])
break;
case 'h':
+ /* FALLTHRU */
case KEY_HOME:
lptr = vec_lines;
break;
+ case '<':
+ if ((shift -= 8) < 0)
+ shift = 0;
+ break;
+ case '>':
+ shift += 8;
+ break;
+
case 'e':
+ /* FALLTHRU */
case KEY_END:
if (num_lines > LINES)
- lptr = vec_lines + num_lines - LINES + 1;
+ lptr = (vec_lines + num_lines - LINES + 1);
else
- lptr = vec_lines;
+ lptr = (vec_lines + (num_lines - 2));
+ break;
+
+ case CTRL('F'):
+ /* FALLTHRU */
+ case KEY_NPAGE:
+ for (i = 0; i < n; i++) {
+ if ((lptr - vec_lines) < (num_lines - 5))
+ lptr += (LINES - 1);
+ else
+ lptr = (vec_lines + num_lines - 2);
+ }
+ break;
+
+ case CTRL('B'):
+ /* FALLTHRU */
+ case KEY_PPAGE:
+ for (i = 0; i < n; i++) {
+ if ((lptr - vec_lines) >= LINES)
+ lptr -= (LINES - 1);
+ else
+ lptr = vec_lines;
+ }
break;
case 'r':
@@ -468,6 +600,8 @@ main(int argc, char *argv[])
break;
case 'q':
+ case QUIT:
+ case ESCAPE:
done = TRUE;
break;
@@ -476,12 +610,17 @@ main(int argc, char *argv[])
break;
#endif
case 's':
+#if HAVE_HALFDELAY
if (got_number) {
halfdelay(my_delay = n);
} else {
nodelay(stdscr, FALSE);
my_delay = -1;
}
+#else
+ nodelay(stdscr, FALSE);
+ my_delay = -1;
+#endif
break;
case ' ':
nodelay(stdscr, TRUE);
@@ -494,6 +633,9 @@ main(int argc, char *argv[])
if (!my_delay)
napms(50);
break;
+ case HELP_KEY_1:
+ popup_msg(stdscr, help);
+ break;
default:
beep();
break;
@@ -506,105 +648,3 @@ main(int argc, char *argv[])
finish(0); /* we're done */
}
-
-static void
-finish(int sig)
-{
- endwin();
-#if NO_LEAKS
- if (vec_lines != 0) {
- int n;
- for (n = 0; n < num_lines; ++n) {
- free(vec_lines[n]);
- }
- free(vec_lines);
- }
-#endif
- ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
-}
-
-#if CAN_RESIZE
-/*
- * This uses functions that are "unsafe", but it seems to work on SunOS.
- * Usually: the "unsafe" refers to the functions that POSIX lists which may be
- * called from a signal handler. Those do not include buffered I/O, which is
- * used for instance in wrefresh(). To be really portable, you should use the
- * KEY_RESIZE return (which relies on ncurses' sigwinch handler).
- *
- * The 'wrefresh(curscr)' is needed to force the refresh to start from the top
- * of the screen -- some xterms mangle the bitmap while resizing.
- */
-static void
-adjust(int sig)
-{
- if (waiting || sig == 0) {
- struct winsize size;
-
- if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
- resize_term(size.ws_row, size.ws_col);
- wrefresh(curscr);
- show_all(sig ? "SIGWINCH" : "interrupt");
- }
- interrupted = FALSE;
- } else {
- interrupted = TRUE;
- }
- (void) signal(SIGWINCH, adjust); /* some systems need this */
-}
-#endif /* CAN_RESIZE */
-
-static void
-show_all(const char *tag)
-{
- int i;
- char temp[BUFSIZ];
- NCURSES_CH_T *s;
- time_t this_time;
-
-#if CAN_RESIZE
- sprintf(temp, "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
- i = (int) strlen(temp);
- if ((i + 7) < (int) sizeof(temp)) {
- sprintf(temp + i, "view %.*s",
- (int) (sizeof(temp) - 7 - (size_t) i),
- fname);
- }
-#else
- (void) tag;
- sprintf(temp, "view %.*s", (int) sizeof(temp) - 7, fname);
-#endif
- move(0, 0);
- printw("%.*s", COLS, temp);
- clrtoeol();
- this_time = time((time_t *) 0);
- strncpy(temp, ctime(&this_time), (size_t) 30);
- if ((i = (int) strlen(temp)) != 0) {
- temp[--i] = 0;
- if (move(0, COLS - i - 2) != ERR)
- printw(" %s", temp);
- }
-
- scrollok(stdscr, FALSE); /* prevent screen from moving */
- for (i = 1; i < LINES; i++) {
- move(i, 0);
- printw("%3ld:", (long) (lptr + i - vec_lines));
- clrtoeol();
- if ((s = lptr[i - 1]) != 0) {
- int len = ch_len(s);
- if (len > shift) {
-#if USE_WIDEC_SUPPORT
- add_wchstr(s + shift);
-#else
- addchstr(s + shift);
-#endif
- }
-#if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT)
- if (try_color)
- wchgat(stdscr, -1, A_NORMAL, my_pair, NULL);
-#endif
- }
- }
- setscrreg(1, LINES - 1);
- scrollok(stdscr, TRUE);
- refresh();
-}
diff --git a/test/widechars-utf8-tabs.txt b/test/widechars-utf8-tabs.txt
new file mode 100644
index 0000000..ca605a1
--- /dev/null
+++ b/test/widechars-utf8-tabs.txt
@@ -0,0 +1,15 @@
+APPLE -- It's an APPLE.
+DOG -- No, that's not my DOG.
+ORANGE -- Yeah, that's JUICY.
+CHICKEN -- Normally not a PET.
+CAT -- No, never put a DOG and a CAT together!
+FISH -- Cats like FISH.
+LEMON -- You KNOW how it TASTES.
+----+----1----+----2----+----3----+----4
+APPLE -- It's an APPLE.
+ APPLE -- It's an APPLE.
+ APPLE -- It's an APPLE.
+ APPLE -- It's an APPLE.
+ APPLE -- It's an APPLE.
+ APPLE -- It's an APPLE.
+----+----1----+----2----+----3----+----4
diff --git a/test/widechars.h b/test/widechars.h
index e7897ba..87c828f 100644
--- a/test/widechars.h
+++ b/test/widechars.h
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 2012 Free Software Foundation, Inc. *
+ * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2012 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 +34,7 @@
#if USE_WIDEC_SUPPORT
-#if defined(__MINGW32__)
+#if defined(_WIN32)
/*
* MinGW has wide-character functions, but they do not work correctly.
*/
@@ -45,7 +46,7 @@ extern int __MINGW_NOTHROW _nc_mbtowc(wchar_t *pwc, const char *s, size_t n);
extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t);
#define mblen(s,n) _nc_mblen(s, n)
-#endif /* __MINGW32__ */
+#endif /* _WIN32 */
#if HAVE_MBTOWC && HAVE_MBLEN
#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
diff --git a/test/worm.c b/test/worm.c
index c3fc0da..6304e4b 100644
--- a/test/worm.c
+++ b/test/worm.c
@@ -1,5 +1,6 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -47,25 +48,20 @@
July 1995 (esr): worms is now in living color! :-)
-Options:
- -f fill screen with copies of 'WORM' at start.
- -l <n> set worm length
- -n <n> set number of worms
- -t make worms leave droppings
- -T <start> <end> set trace interval
- -S set single-stepping during trace interval
- -N suppress cursor-movement optimization
-
This program makes a good torture-test for the ncurses cursor-optimization
code. You can use -T to set the worm move interval over which movement
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.65 2013/06/22 20:01:41 tom Exp $
+ $Id: worm.c,v 1.82 2020/02/02 23:34:34 tom Exp $
*/
#include <test.priv.h>
+#ifndef NCURSES_VERSION
+#undef TRACE
+#endif
+
#ifdef USE_PTHREADS
#include <pthread.h>
#endif
@@ -102,6 +98,7 @@ static unsigned long sequence = 0;
static bool quitting = FALSE;
static WORM worm[MAX_WORMS];
+static int max_refs;
static int **refs;
static int last_x, last_y;
@@ -201,20 +198,34 @@ static const struct options {
};
/* *INDENT-ON* */
+#if HAVE_USE_WINDOW
+static int
+safe_wgetch(WINDOW *w, void *data GCC_UNUSED)
+{
+ return wgetch(w);
+}
+static int
+safe_wrefresh(WINDOW *w, void *data GCC_UNUSED)
+{
+ return wrefresh(w);
+}
+#endif
+
+#ifdef KEY_RESIZE
static void
failed(const char *s)
{
perror(s);
- endwin();
+ stop_curses();
ExitProgram(EXIT_FAILURE);
}
+#endif
static void
cleanup(void)
{
- USING_WINDOW(stdscr, wrefresh);
- curs_set(1);
- endwin();
+ USING_WINDOW1(stdscr, wrefresh, safe_wrefresh);
+ stop_curses();
}
static void
@@ -294,6 +305,7 @@ draw_worm(WINDOW *win, void *data)
switch (op->nopts) {
case 0:
done = TRUE;
+ Trace(("done - draw_worm"));
break;
case 1:
w->orientation = op->opts[0];
@@ -324,9 +336,9 @@ draw_worm(WINDOW *win, void *data)
static bool
quit_worm(int bitnum)
{
- pending |= (1 << bitnum);
+ pending = (pending | (unsigned) (1 << bitnum));
napms(10); /* let the other thread(s) have a chance */
- pending &= ~(1 << bitnum);
+ pending = (pending & (unsigned) ~(1 << bitnum));
return quitting;
}
@@ -335,7 +347,7 @@ start_worm(void *arg)
{
unsigned long compare = 0;
Trace(("start_worm"));
- while (!quit_worm(((struct worm *) arg) - worm)) {
+ while (!quit_worm((int) (((struct worm *) arg) - worm))) {
while (compare < sequence) {
++compare;
#if HAVE_USE_WINDOW
@@ -384,17 +396,18 @@ static int
get_input(void)
{
int ch;
- ch = USING_WINDOW(stdscr, wgetch);
+ ch = USING_WINDOW1(stdscr, wgetch, safe_wgetch);
return ch;
}
#ifdef KEY_RESIZE
static int
-update_refs(WINDOW *win)
+update_refs(WINDOW *win, void *data)
{
int x, y;
(void) win;
+ (void) data;
if (last_x != COLS - 1) {
for (y = 0; y <= last_y; y++) {
refs[y] = typeRealloc(int, (size_t) COLS, refs[y]);
@@ -408,6 +421,7 @@ update_refs(WINDOW *win)
if (last_y != LINES - 1) {
for (y = LINES; y <= last_y; y++)
free(refs[y]);
+ max_refs = LINES;
refs = typeRealloc(int *, (size_t) LINES, refs);
for (y = last_y + 1; y < LINES; y++) {
refs[y] = typeMalloc(int, (size_t) COLS);
@@ -422,41 +436,69 @@ update_refs(WINDOW *win)
}
#endif
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: worm [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -f fill screen with copies of \"WORM\" at start"
+ ," -l <n> set length of worms"
+ ," -n <n> set number of worms"
+ ," -t leave trail of \".\""
+#ifdef TRACE
+ ," -T <start>,<end> set trace interval"
+ ," -N suppress cursor-movement optimization"
+#endif
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
main(int argc, char *argv[])
{
+ int ch;
int x, y;
int n;
struct worm *w;
int *ip;
bool done = FALSE;
- int max_refs;
+#if HAVE_USE_DEFAULT_COLORS
+ bool opt_d = FALSE;
+#endif
setlocale(LC_ALL, "");
- for (x = 1; x < argc; x++) {
- char *p;
- p = argv[x];
- if (*p == '-')
- p++;
- switch (*p) {
+ while ((ch = getopt(argc, argv, "dfl:n:tT:N")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ opt_d = TRUE;
+ break;
+#endif
case 'f':
field = "WORM";
break;
case 'l':
- if (++x == argc)
- goto usage;
- if ((length = atoi(argv[x])) < 2 || length > MAX_LENGTH) {
+ if ((length = atoi(optarg)) < 2 || length > MAX_LENGTH) {
fprintf(stderr, "%s: Invalid length\n", *argv);
- ExitProgram(EXIT_FAILURE);
+ usage();
}
break;
case 'n':
- if (++x == argc)
- goto usage;
- if ((number = atoi(argv[x])) < 1 || number > MAX_WORMS) {
+ if ((number = atoi(optarg)) < 1 || number > MAX_WORMS) {
fprintf(stderr, "%s: Invalid number of worms\n", *argv);
- ExitProgram(EXIT_FAILURE);
+ usage();
}
break;
case 't':
@@ -464,20 +506,20 @@ main(int argc, char *argv[])
break;
#ifdef TRACE
case 'T':
- trace_start = atoi(argv[++x]);
- trace_end = atoi(argv[++x]);
+ if (sscanf(optarg, "%d,%d", &trace_start, &trace_end) != 2)
+ usage();
break;
case 'N':
_nc_optimize_enable ^= OPTIMIZE_ALL; /* declared by ncurses */
break;
#endif /* TRACE */
default:
- usage:
- fprintf(stderr,
- "usage: %s [-field] [-length #] [-number #] [-trail]\n", *argv);
- ExitProgram(EXIT_FAILURE);
+ usage();
+ /* NOTREACHED */
}
}
+ if (optind < argc)
+ usage();
signal(SIGINT, onsig);
initscr();
@@ -495,7 +537,7 @@ main(int argc, char *argv[])
int bg = COLOR_BLACK;
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (opt_d && (use_default_colors() == OK))
bg = -1;
#endif
@@ -558,21 +600,19 @@ main(int argc, char *argv[])
}
}
}
- USING_WINDOW(stdscr, wrefresh);
+ USING_WINDOW1(stdscr, wrefresh, safe_wrefresh);
nodelay(stdscr, TRUE);
while (!done) {
- int ch;
-
++sequence;
if ((ch = get_input()) > 0) {
#ifdef TRACE
if (trace_start || trace_end) {
if (generation == trace_start) {
- trace(TRACE_CALLS);
+ curses_trace(TRACE_CALLS);
get_input();
} else if (generation == trace_end) {
- trace(0);
+ curses_trace(0);
get_input();
}
@@ -593,6 +633,7 @@ main(int argc, char *argv[])
if (ch == 'q') {
quitting = TRUE;
done = TRUE;
+ Trace(("done - quitting"));
continue;
} else if (ch == 's') {
nodelay(stdscr, FALSE);
@@ -603,12 +644,12 @@ main(int argc, char *argv[])
done = draw_all_worms();
napms(10);
- USING_WINDOW(stdscr, wrefresh);
+ USING_WINDOW1(stdscr, wrefresh, safe_wrefresh);
}
Trace(("Cleanup"));
cleanup();
-#ifdef NO_LEAKS
+#if NO_LEAKS
for (y = 0; y < max_refs; y++) {
free(refs[y]);
}
diff --git a/test/xmas.c b/test/xmas.c
index 087fcd9..78b187c 100644
--- a/test/xmas.c
+++ b/test/xmas.c
@@ -92,7 +92,7 @@
/******************************************************************************/
/*
- * $Id: xmas.c,v 1.28 2013/04/27 19:46:53 tom Exp $
+ * $Id: xmas.c,v 1.34 2019/12/14 23:25:29 tom Exp $
*/
#include <test.priv.h>
@@ -133,21 +133,6 @@ static WINDOW *w_holiday;
static WINDOW *w_del_msg;
static bool *my_pairs;
-static int boxit(void);
-static int seas(void);
-static int greet(void);
-static int fromwho(void);
-static int tree(void);
-static int balls(void);
-static int star(void);
-static int strng1(void);
-static int strng2(void);
-static int strng3(void);
-static int strng4(void);
-static int strng5(void);
-static int reindeer(void);
-static int blinkit(void);
-
static void done(int sig) GCC_NORETURN;
static void
@@ -183,24 +168,544 @@ look_out(int msecs)
}
}
+static int
+boxit(void)
+{
+ int x = 0;
+
+ while (x < 20) {
+ MvAddCh(x, 7, '|');
+ ++x;
+ }
+
+ x = 8;
+
+ while (x < 80) {
+ MvAddCh(19, x, '_');
+ ++x;
+ }
+
+ x = 0;
+
+ while (x < 80) {
+ MvAddCh(22, x, '_');
+ ++x;
+ }
+
+ return (0);
+}
+
+static int
+seas(void)
+{
+ MvAddCh(4, 1, 'S');
+ MvAddCh(6, 1, 'E');
+ MvAddCh(8, 1, 'A');
+ MvAddCh(10, 1, 'S');
+ MvAddCh(12, 1, 'O');
+ MvAddCh(14, 1, 'N');
+ MvAddCh(16, 1, '`');
+ MvAddCh(18, 1, 'S');
+
+ return (0);
+}
+
+static int
+greet(void)
+{
+ MvAddCh(3, 5, 'G');
+ MvAddCh(5, 5, 'R');
+ MvAddCh(7, 5, 'E');
+ MvAddCh(9, 5, 'E');
+ MvAddCh(11, 5, 'T');
+ MvAddCh(13, 5, 'I');
+ MvAddCh(15, 5, 'N');
+ MvAddCh(17, 5, 'G');
+ MvAddCh(19, 5, 'S');
+
+ return (0);
+}
+
+static int
+fromwho(void)
+{
+ MvAddStr(21, 13, FROMWHO);
+ return (0);
+}
+
+static int
+tree(void)
+{
+ set_color(treescrn, COLOR_GREEN);
+ MvWAddCh(treescrn, 1, 11, (chtype) '/');
+ MvWAddCh(treescrn, 2, 11, (chtype) '/');
+ MvWAddCh(treescrn, 3, 10, (chtype) '/');
+ MvWAddCh(treescrn, 4, 9, (chtype) '/');
+ MvWAddCh(treescrn, 5, 9, (chtype) '/');
+ MvWAddCh(treescrn, 6, 8, (chtype) '/');
+ MvWAddCh(treescrn, 7, 7, (chtype) '/');
+ MvWAddCh(treescrn, 8, 6, (chtype) '/');
+ MvWAddCh(treescrn, 9, 6, (chtype) '/');
+ MvWAddCh(treescrn, 10, 5, (chtype) '/');
+ MvWAddCh(treescrn, 11, 3, (chtype) '/');
+ MvWAddCh(treescrn, 12, 2, (chtype) '/');
+
+ MvWAddCh(treescrn, 1, 13, (chtype) '\\');
+ MvWAddCh(treescrn, 2, 13, (chtype) '\\');
+ MvWAddCh(treescrn, 3, 14, (chtype) '\\');
+ MvWAddCh(treescrn, 4, 15, (chtype) '\\');
+ MvWAddCh(treescrn, 5, 15, (chtype) '\\');
+ MvWAddCh(treescrn, 6, 16, (chtype) '\\');
+ MvWAddCh(treescrn, 7, 17, (chtype) '\\');
+ MvWAddCh(treescrn, 8, 18, (chtype) '\\');
+ MvWAddCh(treescrn, 9, 18, (chtype) '\\');
+ MvWAddCh(treescrn, 10, 19, (chtype) '\\');
+ MvWAddCh(treescrn, 11, 21, (chtype) '\\');
+ MvWAddCh(treescrn, 12, 22, (chtype) '\\');
+
+ MvWAddCh(treescrn, 4, 10, (chtype) '_');
+ MvWAddCh(treescrn, 4, 14, (chtype) '_');
+ MvWAddCh(treescrn, 8, 7, (chtype) '_');
+ MvWAddCh(treescrn, 8, 17, (chtype) '_');
+
+ MvWAddStr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
+
+ MvWAddStr(treescrn, 14, 11, "| |");
+ MvWAddStr(treescrn, 15, 11, "|_|");
+
+ unset_color(treescrn);
+ wrefresh(treescrn);
+ wrefresh(w_del_msg);
+
+ return (0);
+}
+
+static int
+balls(void)
+{
+ overlay(treescrn, treescrn2);
+
+ set_color(treescrn2, COLOR_BLUE);
+ MvWAddCh(treescrn2, 3, 9, (chtype) '@');
+ MvWAddCh(treescrn2, 3, 15, (chtype) '@');
+ MvWAddCh(treescrn2, 4, 8, (chtype) '@');
+ MvWAddCh(treescrn2, 4, 16, (chtype) '@');
+ MvWAddCh(treescrn2, 5, 7, (chtype) '@');
+ MvWAddCh(treescrn2, 5, 17, (chtype) '@');
+ MvWAddCh(treescrn2, 7, 6, (chtype) '@');
+ MvWAddCh(treescrn2, 7, 18, (chtype) '@');
+ MvWAddCh(treescrn2, 8, 5, (chtype) '@');
+ MvWAddCh(treescrn2, 8, 19, (chtype) '@');
+ MvWAddCh(treescrn2, 10, 4, (chtype) '@');
+ MvWAddCh(treescrn2, 10, 20, (chtype) '@');
+ MvWAddCh(treescrn2, 11, 2, (chtype) '@');
+ MvWAddCh(treescrn2, 11, 22, (chtype) '@');
+ MvWAddCh(treescrn2, 12, 1, (chtype) '@');
+ MvWAddCh(treescrn2, 12, 23, (chtype) '@');
+
+ unset_color(treescrn2);
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+star(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_YELLOW);
+
+ MvWAddCh(treescrn2, 0, 12, (chtype) '*');
+ (void) wstandend(treescrn2);
+
+ unset_color(treescrn2);
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+strng1(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_WHITE);
+
+ MvWAddCh(treescrn2, 3, 13, (chtype) '\'');
+ MvWAddCh(treescrn2, 3, 12, (chtype) ':');
+ MvWAddCh(treescrn2, 3, 11, (chtype) '.');
+
+ wattroff(treescrn2, A_BOLD | A_BLINK);
+ unset_color(treescrn2);
+
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+strng2(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_WHITE);
+
+ MvWAddCh(treescrn2, 5, 14, (chtype) '\'');
+ MvWAddCh(treescrn2, 5, 13, (chtype) ':');
+ MvWAddCh(treescrn2, 5, 12, (chtype) '.');
+ MvWAddCh(treescrn2, 5, 11, (chtype) ',');
+ MvWAddCh(treescrn2, 6, 10, (chtype) '\'');
+ MvWAddCh(treescrn2, 6, 9, (chtype) ':');
+
+ wattroff(treescrn2, A_BOLD | A_BLINK);
+ unset_color(treescrn2);
+
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+strng3(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_WHITE);
+
+ MvWAddCh(treescrn2, 7, 16, (chtype) '\'');
+ MvWAddCh(treescrn2, 7, 15, (chtype) ':');
+ MvWAddCh(treescrn2, 7, 14, (chtype) '.');
+ MvWAddCh(treescrn2, 7, 13, (chtype) ',');
+ MvWAddCh(treescrn2, 8, 12, (chtype) '\'');
+ MvWAddCh(treescrn2, 8, 11, (chtype) ':');
+ MvWAddCh(treescrn2, 8, 10, (chtype) '.');
+ MvWAddCh(treescrn2, 8, 9, (chtype) ',');
+
+ wattroff(treescrn2, A_BOLD | A_BLINK);
+ unset_color(treescrn2);
+
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+strng4(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_WHITE);
+
+ MvWAddCh(treescrn2, 9, 17, (chtype) '\'');
+ MvWAddCh(treescrn2, 9, 16, (chtype) ':');
+ MvWAddCh(treescrn2, 9, 15, (chtype) '.');
+ MvWAddCh(treescrn2, 9, 14, (chtype) ',');
+ MvWAddCh(treescrn2, 10, 13, (chtype) '\'');
+ MvWAddCh(treescrn2, 10, 12, (chtype) ':');
+ MvWAddCh(treescrn2, 10, 11, (chtype) '.');
+ MvWAddCh(treescrn2, 10, 10, (chtype) ',');
+ MvWAddCh(treescrn2, 11, 9, (chtype) '\'');
+ MvWAddCh(treescrn2, 11, 8, (chtype) ':');
+ MvWAddCh(treescrn2, 11, 7, (chtype) '.');
+ MvWAddCh(treescrn2, 11, 6, (chtype) ',');
+ MvWAddCh(treescrn2, 12, 5, (chtype) '\'');
+
+ wattroff(treescrn2, A_BOLD | A_BLINK);
+ unset_color(treescrn2);
+
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+strng5(void)
+{
+ (void) wattrset(treescrn2, A_BOLD | A_BLINK);
+ set_color(treescrn2, COLOR_WHITE);
+
+ MvWAddCh(treescrn2, 11, 19, (chtype) '\'');
+ MvWAddCh(treescrn2, 11, 18, (chtype) ':');
+ MvWAddCh(treescrn2, 11, 17, (chtype) '.');
+ MvWAddCh(treescrn2, 11, 16, (chtype) ',');
+ MvWAddCh(treescrn2, 12, 15, (chtype) '\'');
+ MvWAddCh(treescrn2, 12, 14, (chtype) ':');
+ MvWAddCh(treescrn2, 12, 13, (chtype) '.');
+ MvWAddCh(treescrn2, 12, 12, (chtype) ',');
+
+ wattroff(treescrn2, A_BOLD | A_BLINK);
+ unset_color(treescrn2);
+
+ /* save a fully lit tree */
+ overlay(treescrn2, treescrn);
+
+ wrefresh(treescrn2);
+ wrefresh(w_del_msg);
+ return (0);
+}
+
+static int
+blinkit(void)
+{
+ static int cycle;
+
+ if (cycle > 4) {
+ cycle = 0;
+ }
+
+ touchwin(treescrn8);
+
+ switch (cycle) {
+ case 0:
+ overlay(treescrn3, treescrn8);
+ break;
+ case 1:
+ overlay(treescrn4, treescrn8);
+ break;
+ case 2:
+ overlay(treescrn5, treescrn8);
+ break;
+ case 3:
+ overlay(treescrn6, treescrn8);
+ break;
+ case 4:
+ overlay(treescrn7, treescrn8);
+ break;
+ }
+ touchwin(treescrn8);
+ wrefresh(treescrn8);
+ wrefresh(w_del_msg);
+ look_out(50);
+
+ /*ALL ON************************************************** */
+
+ overlay(treescrn, treescrn8);
+ wrefresh(treescrn8);
+ wrefresh(w_del_msg);
+ look_out(50);
+
+ ++cycle;
+ return (0);
+}
+
+static void
+deer_step(WINDOW *win, int y, int x)
+{
+ mvwin(win, y, x);
+ wrefresh(win);
+ wrefresh(w_del_msg);
+ look_out(5);
+}
+
+static int
+reindeer(void)
+{
+ int looper;
+ y_pos = 0;
+
+ for (x_pos = 70; x_pos > 62; x_pos--) {
+ if (x_pos < 62) {
+ y_pos = 1;
+ }
+ for (looper = 0; looper < 4; looper++) {
+ MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
+ wrefresh(dotdeer0);
+ wrefresh(w_del_msg);
+ werase(dotdeer0);
+ wrefresh(dotdeer0);
+ wrefresh(w_del_msg);
+ look_out(50);
+ }
+ }
+
+ y_pos = 2;
+
+ for (; x_pos > 50; x_pos--) {
+ for (looper = 0; looper < 4; looper++) {
+
+ if (x_pos < 56) {
+ y_pos = 3;
+
+ MvWAddCh(stardeer0, y_pos, x_pos, (chtype) '*');
+ wrefresh(stardeer0);
+ wrefresh(w_del_msg);
+ werase(stardeer0);
+ wrefresh(stardeer0);
+ wrefresh(w_del_msg);
+ } else {
+ MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '*');
+ wrefresh(dotdeer0);
+ wrefresh(w_del_msg);
+ werase(dotdeer0);
+ wrefresh(dotdeer0);
+ wrefresh(w_del_msg);
+ }
+ }
+ }
+
+ x_pos = 58;
+
+ for (y_pos = 2; y_pos < 5; y_pos++) {
+
+ touchwin(lildeer0);
+ wrefresh(lildeer0);
+ wrefresh(w_del_msg);
+
+ for (looper = 0; looper < 4; looper++) {
+ deer_step(lildeer3, y_pos, x_pos);
+ deer_step(lildeer2, y_pos, x_pos);
+ deer_step(lildeer1, y_pos, x_pos);
+ deer_step(lildeer2, y_pos, x_pos);
+ deer_step(lildeer3, y_pos, x_pos);
+
+ touchwin(lildeer0);
+ wrefresh(lildeer0);
+ wrefresh(w_del_msg);
+
+ x_pos -= 2;
+ }
+ }
+
+ x_pos = 35;
+
+ for (y_pos = 5; y_pos < 10; y_pos++) {
+
+ touchwin(middeer0);
+ wrefresh(middeer0);
+ wrefresh(w_del_msg);
+
+ for (looper = 0; looper < 2; looper++) {
+ deer_step(middeer3, y_pos, x_pos);
+ deer_step(middeer2, y_pos, x_pos);
+ deer_step(middeer1, y_pos, x_pos);
+ deer_step(middeer2, y_pos, x_pos);
+ deer_step(middeer3, y_pos, x_pos);
+
+ touchwin(middeer0);
+ wrefresh(middeer0);
+ wrefresh(w_del_msg);
+
+ x_pos -= 3;
+ }
+ }
+
+ look_out(300);
+
+ y_pos = 1;
+
+ for (x_pos = 8; x_pos < 16; x_pos++) {
+ deer_step(bigdeer4, y_pos, x_pos);
+ deer_step(bigdeer3, y_pos, x_pos);
+ deer_step(bigdeer2, y_pos, x_pos);
+ deer_step(bigdeer1, y_pos, x_pos);
+ deer_step(bigdeer2, y_pos, x_pos);
+ deer_step(bigdeer3, y_pos, x_pos);
+ deer_step(bigdeer4, y_pos, x_pos);
+ deer_step(bigdeer0, y_pos, x_pos);
+ }
+
+ --x_pos;
+
+ for (looper = 0; looper < 6; looper++) {
+ deer_step(lookdeer4, y_pos, x_pos);
+ deer_step(lookdeer3, y_pos, x_pos);
+ deer_step(lookdeer2, y_pos, x_pos);
+ deer_step(lookdeer1, y_pos, x_pos);
+ deer_step(lookdeer2, y_pos, x_pos);
+ deer_step(lookdeer3, y_pos, x_pos);
+ deer_step(lookdeer4, y_pos, x_pos);
+ }
+
+ deer_step(lookdeer0, y_pos, x_pos);
+
+ for (; y_pos < 10; y_pos++) {
+ for (looper = 0; looper < 2; looper++) {
+ deer_step(bigdeer4, y_pos, x_pos);
+ deer_step(bigdeer3, y_pos, x_pos);
+ deer_step(bigdeer2, y_pos, x_pos);
+ deer_step(bigdeer1, y_pos, x_pos);
+ deer_step(bigdeer2, y_pos, x_pos);
+ deer_step(bigdeer3, y_pos, x_pos);
+ deer_step(bigdeer4, y_pos, x_pos);
+ }
+ deer_step(bigdeer0, y_pos, x_pos);
+ }
+
+ --y_pos;
+
+ deer_step(lookdeer3, y_pos, x_pos);
+ return (0);
+}
+
+static void
+done(int sig GCC_UNUSED)
+{
+ move(LINES - 1, 0);
+ refresh();
+ stop_curses();
+
+#if NO_LEAKS
+ if (my_pairs != 0)
+ free(my_pairs);
+#endif
+
+ ExitProgram(EXIT_SUCCESS);
+}
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: xmas [options]"
+ ,""
+ ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+ ," -d invoke use_default_colors"
+#endif
+ ," -q execute once, then quit"
+ };
+ size_t n;
+
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+
+ ExitProgram(EXIT_FAILURE);
+}
+
int
-main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
+main(int argc, char *argv[])
{
+ int ch;
int loopy;
+#if HAVE_USE_DEFAULT_COLORS
+ bool opt_d = FALSE;
+#endif
+ bool opt_q = FALSE;
+
+ while ((ch = getopt(argc, argv, "dq")) != -1) {
+ switch (ch) {
+#if HAVE_USE_DEFAULT_COLORS
+ case 'd':
+ opt_d = TRUE;
+ break;
+#endif
+ case 'q':
+ opt_q = TRUE;
+ break;
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
setlocale(LC_ALL, "");
- initscr();
+ InitAndCatch(initscr(), done);
noecho();
nonl();
refresh();
- CATCHALL(done);
-
if (has_colors()) {
start_color();
#if HAVE_USE_DEFAULT_COLORS
- if (use_default_colors() == OK)
+ if (opt_d && (use_default_colors() == OK))
my_bg = -1;
#endif
}
@@ -244,7 +749,7 @@ main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
(w_holiday = newwin(1, 26, 3, 27)) == 0 ||
(w_del_msg = newwin(1, 19, 23, 60)) == 0) {
- endwin();
+ stop_curses();
fprintf(stderr, "Cannot create windows - screen too small\n");
ExitProgram(EXIT_FAILURE);
}
@@ -450,7 +955,7 @@ main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
/***********************************************/
cbreak();
nodelay(stdscr, TRUE);
- for (;;) {
+ do {
clear();
werase(treescrn);
touchwin(w_del_msg);
@@ -664,499 +1169,6 @@ main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
for (loopy = 0; loopy < 100; loopy++) {
blinkit();
}
-
-#ifdef NOLOOP
- done(0);
-#endif
- }
- /*NOTREACHED */
-}
-
-static int
-boxit(void)
-{
- int x = 0;
-
- while (x < 20) {
- MvAddCh(x, 7, '|');
- ++x;
- }
-
- x = 8;
-
- while (x < 80) {
- MvAddCh(19, x, '_');
- ++x;
- }
-
- x = 0;
-
- while (x < 80) {
- MvAddCh(22, x, '_');
- ++x;
- }
-
- return (0);
-}
-
-static int
-seas(void)
-{
- MvAddCh(4, 1, 'S');
- MvAddCh(6, 1, 'E');
- MvAddCh(8, 1, 'A');
- MvAddCh(10, 1, 'S');
- MvAddCh(12, 1, 'O');
- MvAddCh(14, 1, 'N');
- MvAddCh(16, 1, '`');
- MvAddCh(18, 1, 'S');
-
- return (0);
-}
-
-static int
-greet(void)
-{
- MvAddCh(3, 5, 'G');
- MvAddCh(5, 5, 'R');
- MvAddCh(7, 5, 'E');
- MvAddCh(9, 5, 'E');
- MvAddCh(11, 5, 'T');
- MvAddCh(13, 5, 'I');
- MvAddCh(15, 5, 'N');
- MvAddCh(17, 5, 'G');
- MvAddCh(19, 5, 'S');
-
- return (0);
-}
-
-static int
-fromwho(void)
-{
- MvAddStr(21, 13, FROMWHO);
- return (0);
-}
-
-static int
-tree(void)
-{
- set_color(treescrn, COLOR_GREEN);
- MvWAddCh(treescrn, 1, 11, (chtype) '/');
- MvWAddCh(treescrn, 2, 11, (chtype) '/');
- MvWAddCh(treescrn, 3, 10, (chtype) '/');
- MvWAddCh(treescrn, 4, 9, (chtype) '/');
- MvWAddCh(treescrn, 5, 9, (chtype) '/');
- MvWAddCh(treescrn, 6, 8, (chtype) '/');
- MvWAddCh(treescrn, 7, 7, (chtype) '/');
- MvWAddCh(treescrn, 8, 6, (chtype) '/');
- MvWAddCh(treescrn, 9, 6, (chtype) '/');
- MvWAddCh(treescrn, 10, 5, (chtype) '/');
- MvWAddCh(treescrn, 11, 3, (chtype) '/');
- MvWAddCh(treescrn, 12, 2, (chtype) '/');
-
- MvWAddCh(treescrn, 1, 13, (chtype) '\\');
- MvWAddCh(treescrn, 2, 13, (chtype) '\\');
- MvWAddCh(treescrn, 3, 14, (chtype) '\\');
- MvWAddCh(treescrn, 4, 15, (chtype) '\\');
- MvWAddCh(treescrn, 5, 15, (chtype) '\\');
- MvWAddCh(treescrn, 6, 16, (chtype) '\\');
- MvWAddCh(treescrn, 7, 17, (chtype) '\\');
- MvWAddCh(treescrn, 8, 18, (chtype) '\\');
- MvWAddCh(treescrn, 9, 18, (chtype) '\\');
- MvWAddCh(treescrn, 10, 19, (chtype) '\\');
- MvWAddCh(treescrn, 11, 21, (chtype) '\\');
- MvWAddCh(treescrn, 12, 22, (chtype) '\\');
-
- MvWAddCh(treescrn, 4, 10, (chtype) '_');
- MvWAddCh(treescrn, 4, 14, (chtype) '_');
- MvWAddCh(treescrn, 8, 7, (chtype) '_');
- MvWAddCh(treescrn, 8, 17, (chtype) '_');
-
- MvWAddStr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
-
- MvWAddStr(treescrn, 14, 11, "| |");
- MvWAddStr(treescrn, 15, 11, "|_|");
-
- unset_color(treescrn);
- wrefresh(treescrn);
- wrefresh(w_del_msg);
-
- return (0);
-}
-
-static int
-balls(void)
-{
- overlay(treescrn, treescrn2);
-
- set_color(treescrn2, COLOR_BLUE);
- MvWAddCh(treescrn2, 3, 9, (chtype) '@');
- MvWAddCh(treescrn2, 3, 15, (chtype) '@');
- MvWAddCh(treescrn2, 4, 8, (chtype) '@');
- MvWAddCh(treescrn2, 4, 16, (chtype) '@');
- MvWAddCh(treescrn2, 5, 7, (chtype) '@');
- MvWAddCh(treescrn2, 5, 17, (chtype) '@');
- MvWAddCh(treescrn2, 7, 6, (chtype) '@');
- MvWAddCh(treescrn2, 7, 18, (chtype) '@');
- MvWAddCh(treescrn2, 8, 5, (chtype) '@');
- MvWAddCh(treescrn2, 8, 19, (chtype) '@');
- MvWAddCh(treescrn2, 10, 4, (chtype) '@');
- MvWAddCh(treescrn2, 10, 20, (chtype) '@');
- MvWAddCh(treescrn2, 11, 2, (chtype) '@');
- MvWAddCh(treescrn2, 11, 22, (chtype) '@');
- MvWAddCh(treescrn2, 12, 1, (chtype) '@');
- MvWAddCh(treescrn2, 12, 23, (chtype) '@');
-
- unset_color(treescrn2);
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-star(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_YELLOW);
-
- MvWAddCh(treescrn2, 0, 12, (chtype) '*');
- (void) wstandend(treescrn2);
-
- unset_color(treescrn2);
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-strng1(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_WHITE);
-
- MvWAddCh(treescrn2, 3, 13, (chtype) '\'');
- MvWAddCh(treescrn2, 3, 12, (chtype) ':');
- MvWAddCh(treescrn2, 3, 11, (chtype) '.');
-
- wattroff(treescrn2, A_BOLD | A_BLINK);
- unset_color(treescrn2);
-
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-strng2(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_WHITE);
-
- MvWAddCh(treescrn2, 5, 14, (chtype) '\'');
- MvWAddCh(treescrn2, 5, 13, (chtype) ':');
- MvWAddCh(treescrn2, 5, 12, (chtype) '.');
- MvWAddCh(treescrn2, 5, 11, (chtype) ',');
- MvWAddCh(treescrn2, 6, 10, (chtype) '\'');
- MvWAddCh(treescrn2, 6, 9, (chtype) ':');
-
- wattroff(treescrn2, A_BOLD | A_BLINK);
- unset_color(treescrn2);
-
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-strng3(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_WHITE);
-
- MvWAddCh(treescrn2, 7, 16, (chtype) '\'');
- MvWAddCh(treescrn2, 7, 15, (chtype) ':');
- MvWAddCh(treescrn2, 7, 14, (chtype) '.');
- MvWAddCh(treescrn2, 7, 13, (chtype) ',');
- MvWAddCh(treescrn2, 8, 12, (chtype) '\'');
- MvWAddCh(treescrn2, 8, 11, (chtype) ':');
- MvWAddCh(treescrn2, 8, 10, (chtype) '.');
- MvWAddCh(treescrn2, 8, 9, (chtype) ',');
-
- wattroff(treescrn2, A_BOLD | A_BLINK);
- unset_color(treescrn2);
-
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-strng4(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_WHITE);
-
- MvWAddCh(treescrn2, 9, 17, (chtype) '\'');
- MvWAddCh(treescrn2, 9, 16, (chtype) ':');
- MvWAddCh(treescrn2, 9, 15, (chtype) '.');
- MvWAddCh(treescrn2, 9, 14, (chtype) ',');
- MvWAddCh(treescrn2, 10, 13, (chtype) '\'');
- MvWAddCh(treescrn2, 10, 12, (chtype) ':');
- MvWAddCh(treescrn2, 10, 11, (chtype) '.');
- MvWAddCh(treescrn2, 10, 10, (chtype) ',');
- MvWAddCh(treescrn2, 11, 9, (chtype) '\'');
- MvWAddCh(treescrn2, 11, 8, (chtype) ':');
- MvWAddCh(treescrn2, 11, 7, (chtype) '.');
- MvWAddCh(treescrn2, 11, 6, (chtype) ',');
- MvWAddCh(treescrn2, 12, 5, (chtype) '\'');
-
- wattroff(treescrn2, A_BOLD | A_BLINK);
- unset_color(treescrn2);
-
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-strng5(void)
-{
- (void) wattrset(treescrn2, A_BOLD | A_BLINK);
- set_color(treescrn2, COLOR_WHITE);
-
- MvWAddCh(treescrn2, 11, 19, (chtype) '\'');
- MvWAddCh(treescrn2, 11, 18, (chtype) ':');
- MvWAddCh(treescrn2, 11, 17, (chtype) '.');
- MvWAddCh(treescrn2, 11, 16, (chtype) ',');
- MvWAddCh(treescrn2, 12, 15, (chtype) '\'');
- MvWAddCh(treescrn2, 12, 14, (chtype) ':');
- MvWAddCh(treescrn2, 12, 13, (chtype) '.');
- MvWAddCh(treescrn2, 12, 12, (chtype) ',');
-
- wattroff(treescrn2, A_BOLD | A_BLINK);
- unset_color(treescrn2);
-
- /* save a fully lit tree */
- overlay(treescrn2, treescrn);
-
- wrefresh(treescrn2);
- wrefresh(w_del_msg);
- return (0);
-}
-
-static int
-blinkit(void)
-{
- static int cycle;
-
- if (cycle > 4) {
- cycle = 0;
- }
-
- touchwin(treescrn8);
-
- switch (cycle) {
- case 0:
- overlay(treescrn3, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
- break;
- case 1:
- overlay(treescrn4, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
- break;
- case 2:
- overlay(treescrn5, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
- break;
- case 3:
- overlay(treescrn6, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
- break;
- case 4:
- overlay(treescrn7, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
- break;
- }
- touchwin(treescrn8);
-
- /*ALL ON************************************************** */
-
- overlay(treescrn, treescrn8);
- wrefresh(treescrn8);
- wrefresh(w_del_msg);
-
- ++cycle;
- return (0);
-}
-
-static void
-deer_step(WINDOW *win, int y, int x)
-{
- mvwin(win, y, x);
- wrefresh(win);
- wrefresh(w_del_msg);
- look_out(5);
-}
-
-static int
-reindeer(void)
-{
- int looper;
- y_pos = 0;
-
- for (x_pos = 70; x_pos > 62; x_pos--) {
- if (x_pos < 62) {
- y_pos = 1;
- }
- for (looper = 0; looper < 4; looper++) {
- MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
- wrefresh(dotdeer0);
- wrefresh(w_del_msg);
- werase(dotdeer0);
- wrefresh(dotdeer0);
- wrefresh(w_del_msg);
- look_out(50);
- }
- }
-
- y_pos = 2;
-
- for (; x_pos > 50; x_pos--) {
- for (looper = 0; looper < 4; looper++) {
-
- if (x_pos < 56) {
- y_pos = 3;
-
- MvWAddCh(stardeer0, y_pos, x_pos, (chtype) '*');
- wrefresh(stardeer0);
- wrefresh(w_del_msg);
- werase(stardeer0);
- wrefresh(stardeer0);
- wrefresh(w_del_msg);
- } else {
- MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '*');
- wrefresh(dotdeer0);
- wrefresh(w_del_msg);
- werase(dotdeer0);
- wrefresh(dotdeer0);
- wrefresh(w_del_msg);
- }
- }
- }
-
- x_pos = 58;
-
- for (y_pos = 2; y_pos < 5; y_pos++) {
-
- touchwin(lildeer0);
- wrefresh(lildeer0);
- wrefresh(w_del_msg);
-
- for (looper = 0; looper < 4; looper++) {
- deer_step(lildeer3, y_pos, x_pos);
- deer_step(lildeer2, y_pos, x_pos);
- deer_step(lildeer1, y_pos, x_pos);
- deer_step(lildeer2, y_pos, x_pos);
- deer_step(lildeer3, y_pos, x_pos);
-
- touchwin(lildeer0);
- wrefresh(lildeer0);
- wrefresh(w_del_msg);
-
- x_pos -= 2;
- }
- }
-
- x_pos = 35;
-
- for (y_pos = 5; y_pos < 10; y_pos++) {
-
- touchwin(middeer0);
- wrefresh(middeer0);
- wrefresh(w_del_msg);
-
- for (looper = 0; looper < 2; looper++) {
- deer_step(middeer3, y_pos, x_pos);
- deer_step(middeer2, y_pos, x_pos);
- deer_step(middeer1, y_pos, x_pos);
- deer_step(middeer2, y_pos, x_pos);
- deer_step(middeer3, y_pos, x_pos);
-
- touchwin(middeer0);
- wrefresh(middeer0);
- wrefresh(w_del_msg);
-
- x_pos -= 3;
- }
- }
-
- look_out(300);
-
- y_pos = 1;
-
- for (x_pos = 8; x_pos < 16; x_pos++) {
- deer_step(bigdeer4, y_pos, x_pos);
- deer_step(bigdeer3, y_pos, x_pos);
- deer_step(bigdeer2, y_pos, x_pos);
- deer_step(bigdeer1, y_pos, x_pos);
- deer_step(bigdeer2, y_pos, x_pos);
- deer_step(bigdeer3, y_pos, x_pos);
- deer_step(bigdeer4, y_pos, x_pos);
- deer_step(bigdeer0, y_pos, x_pos);
- }
-
- --x_pos;
-
- for (looper = 0; looper < 6; looper++) {
- deer_step(lookdeer4, y_pos, x_pos);
- deer_step(lookdeer3, y_pos, x_pos);
- deer_step(lookdeer2, y_pos, x_pos);
- deer_step(lookdeer1, y_pos, x_pos);
- deer_step(lookdeer2, y_pos, x_pos);
- deer_step(lookdeer3, y_pos, x_pos);
- deer_step(lookdeer4, y_pos, x_pos);
- }
-
- deer_step(lookdeer0, y_pos, x_pos);
-
- for (; y_pos < 10; y_pos++) {
- for (looper = 0; looper < 2; looper++) {
- deer_step(bigdeer4, y_pos, x_pos);
- deer_step(bigdeer3, y_pos, x_pos);
- deer_step(bigdeer2, y_pos, x_pos);
- deer_step(bigdeer1, y_pos, x_pos);
- deer_step(bigdeer2, y_pos, x_pos);
- deer_step(bigdeer3, y_pos, x_pos);
- deer_step(bigdeer4, y_pos, x_pos);
- }
- deer_step(bigdeer0, y_pos, x_pos);
- }
-
- --y_pos;
-
- deer_step(lookdeer3, y_pos, x_pos);
- return (0);
-}
-
-static void
-done(int sig GCC_UNUSED)
-{
- CATCHALL(done);
-
- move(LINES - 1, 0);
- refresh();
- endwin();
- curs_set(1);
-
-#if NO_LEAKS
- if (my_pairs != 0)
- free(my_pairs);
-#endif
-
- ExitProgram(EXIT_SUCCESS);
+ } while (!opt_q);
+ done(0);
}
diff --git a/test/xterm-16color.dat b/test/xterm-16color.dat
index 6d47d93..35aa099 100644
--- a/test/xterm-16color.dat
+++ b/test/xterm-16color.dat
@@ -1,5 +1,6 @@
##############################################################################
-# Copyright (c) 2004,2006 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2004-2006,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 "Software"), #
@@ -25,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: xterm-16color.dat,v 1.2 2006/04/22 21:40:00 tom Exp $
+# $Id: xterm-16color.dat,v 1.4 2020/02/08 21:38:22 tom Exp $
# This illustrates the predefined colors for XFree86 xterm's "xterm-16color".
# If you set $TERM to "xterm-88color" (and have xterm compiled to support the
# 88-color or 256-color feature), you can use the ncurses 'd' screen to
@@ -33,13 +34,13 @@
# the first 16 colors, and xterm happens to use the same first 16 colors in
# the extended color models that support initc.
#
-# The colors shown are for xterm patch #189.
+# The colors shown are for xterm patch #192.
scale:255
0: 0 0 0 black
1: 205 0 0 red3
2: 0 205 0 green3
3: 205 205 0 yellow3
-4: 30 144 255 DodgerBlue1
+4: 0 0 238 blue2
5: 205 0 205 magenta3
6: 0 205 205 cyan3
7: 229 229 229 gray90
@@ -47,7 +48,7 @@ scale:255
9: 255 0 0 red
10: 0 255 0 green
11: 255 255 0 yellow
-12: 99 184 255 SteelBlue1
+12: 92 92 255 customblue
13: 255 0 255 magenta
14: 0 255 255 cyan
15: 255 255 255 white
diff --git a/test/xterm-256color.dat b/test/xterm-256color.dat
index 3dcaabd..28f518e 100644
--- a/test/xterm-256color.dat
+++ b/test/xterm-256color.dat
@@ -1,5 +1,6 @@
##############################################################################
-# Copyright (c) 2009 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2009,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 "Software"), #
@@ -25,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: xterm-256color.dat,v 1.1 2009/10/30 22:33:40 tom Exp $
+# $Id: xterm-256color.dat,v 1.3 2020/02/08 21:38:22 tom Exp $
# This illustrates the predefined colors for xterm's "xterm-256color" feature.
# If you set $TERM to "xterm-256color" (and have xterm compiled to support the
# 256-color feature), you can use the ncurses 'd' screen to
@@ -33,13 +34,13 @@
# the first 16 colors, and xterm happens to use the same first 16 colors in
# the extended color models that support initc.
#
-# The colors shown are for xterm patch #189.
+# The colors shown are for xterm patch #192.
scale:255
0: 0 0 0 black
1: 205 0 0 red3
2: 0 205 0 green3
3: 205 205 0 yellow3
-4: 30 144 255 DodgerBlue1
+4: 0 0 238 blue2
5: 205 0 205 magenta3
6: 0 205 205 cyan3
7: 229 229 229 gray90
@@ -47,7 +48,7 @@ scale:255
9: 255 0 0 red
10: 0 255 0 green
11: 255 255 0 yellow
-12: 99 184 255 SteelBlue1
+12: 92 92 255 customblue
13: 255 0 255 magenta
14: 0 255 255 cyan
15: 255 255 255 white
diff --git a/test/xterm-88color.dat b/test/xterm-88color.dat
index 95a753c..48ee18b 100644
--- a/test/xterm-88color.dat
+++ b/test/xterm-88color.dat
@@ -1,5 +1,6 @@
##############################################################################
-# Copyright (c) 2005-2006,2009 Free Software Foundation, Inc. #
+# Copyright 2020 Thomas E. Dickey #
+# Copyright 2005-2009,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 "Software"), #
@@ -25,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: xterm-88color.dat,v 1.3 2009/10/30 22:33:56 tom Exp $
+# $Id: xterm-88color.dat,v 1.5 2020/02/08 21:38:22 tom Exp $
# This illustrates the predefined colors for xterm's "xterm-88color" feature.
# If you set $TERM to "xterm-88color" (and have xterm compiled to support the
# 88-color or 256-color feature), you can use the ncurses 'd' screen to
@@ -33,13 +34,13 @@
# the first 16 colors, and xterm happens to use the same first 16 colors in
# the extended color models that support initc.
#
-# The colors shown are for xterm patch #189.
+# The colors shown are for xterm patch #192.
scale:255
0: 0 0 0 black
1: 205 0 0 red3
2: 0 205 0 green3
3: 205 205 0 yellow3
-4: 30 144 255 DodgerBlue1
+4: 0 0 238 blue2
5: 205 0 205 magenta3
6: 0 205 205 cyan3
7: 229 229 229 gray90
@@ -47,7 +48,7 @@ scale:255
9: 255 0 0 red
10: 0 255 0 green
11: 255 255 0 yellow
-12: 99 184 255 SteelBlue1
+12: 92 92 255 customblue
13: 255 0 255 magenta
14: 0 255 255 cyan
15: 255 255 255 white
diff --git a/test/xterm-color_48x48.xpm b/test/xterm-color_48x48.xpm
new file mode 100644
index 0000000..d8a501f
--- /dev/null
+++ b/test/xterm-color_48x48.xpm
@@ -0,0 +1,61 @@
+/* XPM */
+static char * xterm_color_48x48_xpm[] = {
+"48 48 10 1",
+". c None",
+" c #555500",
+"+ c #000000",
+"@ c #FFFFFF",
+"# c #FF0000",
+"$ c #070700",
+"% c #0B0B00",
+"& c #FF8400",
+"* c #49FF00",
+"= c #60B7FF",
+"................................................",
+"......++++++++++++++++++++++++++++++++++........",
+".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
+".....+@@@++++++++++++++++++++++++++++@@@+@+.....",
+".....+@@++++++++++++++++++++++++++++++@@+@@+....",
+".....+@++++++++++++++++++++++++++++++++@+@@@+...",
+".....+@++###++++###++++++++++++++++++++@+@@@@+..",
+".....+@+++##++++##+++++++++++++++++++++@+@@@@+..",
+".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
+".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
+".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
+".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
+".....+@++++++##++++++++++++++++++++++++@+@@@@+..",
+".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
+".....+@+++++####+++++++++++++++++++++++@+@@@@+..",
+".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
+".....+@++++##++##++++++++++++++++++++++@+@@@@+..",
+".....+@+++##++++##+++++++++++++++++++++@+@@@@+..",
+".....+@++###++++###++++++++++++++++++++@+@@@@+..",
+".....+@++++++++++++++++++++++++++++++++@+@@@@+..",
+".....+@$+++++++++++++++++++++++++++++++@+@@@@+..",
+".....+@%@@@@@@@+&&&&&++****+++==+++==++@+@@@@+..",
+".....+@++++@++++&++++++*+++*++==+++==++@+@@@@+..",
+".....+@++++@++++&++++++*+++*++=+=+=+=++@+@@@@+..",
+".....+@++++@++++&&&&+++****+++=+=+=+=++@+@@@@+..",
+".....+@++++@++++&++++++*+*++++=++=++=++@+@@@+...",
+".....+@++++@++++&++++++*++*+++=++=++=++@+@@@+...",
+".....+@++++@++++&&&&&++*+++*++=+++++=++@+@@+....",
+".....+@++++++++++++++++++++++++++++++++@+@@+....",
+".....+@++++++++++++++++++++++++++++++++@+@+.....",
+".....+@@++++++++++++++++++++++++++++++@@+@+.....",
+".....+@@@++++++++++++++++++++++++++++@@@++......",
+".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
+"......++++++++++++++++++++++++++++++++++........",
+"................................................",
+"................................................",
+"......++++++++++++++++++++++++++++++++++++......",
+".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......",
+".....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@++......",
+"....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+......",
+"....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@+......",
+"...+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+......",
+"...+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@@+......",
+"..+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+.......",
+"..+@++@++++++++++++++++++++++++++@++@+@+........",
+".+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+.........",
+".+++++++++++++++++++++++++++++++++++++..........",
+"................................................"};